Created
April 10, 2015 12:36
-
-
Save pofider/1f7b5abc80d6f29e5b4e to your computer and use it in GitHub Desktop.
Send email notification using jsreport script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function afterRender(done) { | |
var SendGrid = require('sendgrid'); | |
var sendgrid = new SendGrid('xxx', 'xxx'); | |
sendgrid.send({ | |
to: request.data.email, from: 'jan.blaha@hotmail.com', subject: request.template.name, | |
html: new Buffer(response.content).toString() | |
}, function(err, message) { | |
if (err) | |
done(err); | |
done(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment