diff options
author | scottmotte <scott@scottmotte.com> | 2013-08-01 21:24:25 +0000 |
---|---|---|
committer | scottmotte <scott@scottmotte.com> | 2013-08-01 21:24:25 +0000 |
commit | 33eec065d271c772dfc7e422ce3b2d0940062c13 (patch) | |
tree | b6142ac71c145ac73fc5fa28a5d74fd29b8e211a /lib/sendgrid.js | |
parent | ba28e9c6965e9458ba05d0b5e93c43125e121f97 (diff) | |
download | sendgrid-nodejs-33eec065d271c772dfc7e422ce3b2d0940062c13.zip sendgrid-nodejs-33eec065d271c772dfc7e422ce3b2d0940062c13.tar.gz sendgrid-nodejs-33eec065d271c772dfc7e422ce3b2d0940062c13.tar.bz2 |
use error object for 'err' callback param for smtp
Diffstat (limited to 'lib/sendgrid.js')
-rw-r--r-- | lib/sendgrid.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sendgrid.js b/lib/sendgrid.js index ebda0cd..ee25b3c 100644 --- a/lib/sendgrid.js +++ b/lib/sendgrid.js @@ -103,9 +103,9 @@ module.exports = function(api_user, api_key) { } }); - smtpTransport.sendMail(email.toSmtpFormat(), function(err, response) { + smtpTransport.sendMail(email.toSmtpFormat(), function(error, response) { smtpTransport.close(); - if(err) { return callback(err.data, null);} + if(error) { return callback(new Error(error.data), null);} return callback(null, {'message': 'success'}); }); |