Skip to content

Loading…

Pass http response object to the SES sendMail callback #122

Merged
merged 1 commit into from

2 participants

@JoeWagner

Hi Andris,

I am working on an application that uses nodemailer with AWS SES. I would like to be able to inspect and handle the responses from Amazon in the sendMail callback regardless of the status code without parsing error.message. This change would accomplish that and also enable logging the responses from Amazon without modifying engines/ses.js.
Let me know if there is anything I can do to get this pulled.

Thanks for all the work you have put into this great library,
-Joe

@andris9 andris9 merged commit 01b5d8a into nodemailer:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 10, 2012
Showing with 7 additions and 3 deletions.
  1. +6 −2 lib/engines/ses.js
  2. +1 −1 package.json
View
8 lib/engines/ses.js
@@ -124,10 +124,14 @@ SESTransport.prototype.responseHandler = function(callback, response) {
}
if(response.statusCode != 200) {
return typeof callback == "function" &&
- callback(new Error('Email failed: ' + response.statusCode + '\n' + body), null);
+ callback(new Error('Email failed: ' + response.statusCode + '\n' + body), {
+ message: body,
+ response: response
+ });
}
return typeof callback == "function" && callback(null, {
- message: body
+ message: body,
+ response: response
});
});
};
View
2 package.json
@@ -1,7 +1,7 @@
{
"name": "nodemailer",
"description": "Easy to use module to send e-mails, supports unicode and SSL/TLS",
- "version": "0.3.35",
+ "version": "0.3.36",
"author" : "Andris Reinman",
"maintainers":[
{
Something went wrong with that request. Please try again.