Created
January 11, 2015 17:37
-
-
Save elbuo8/d370e4ef5bed75715f1d to your computer and use it in GitHub Desktop.
Parse sending
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
var sendgrid = require('sendgrid'); | |
sendgrid.initialize('SENDGRID-USERNAME', 'SENDGRID-PASSOWORD'); | |
var email = sendgrid.Email(); | |
email.addTo('[email protected]'); | |
email.setFrom('[email protected]'); | |
email.setSubject('Hello!'); | |
email.setText('YAY'); | |
email.addFilter("templates", "enabled", "1"); | |
email.addFilter("templates", "template_id","the_code_of_the_needed_template"); | |
sendgrid.sendEmail(email, { | |
success: function(httpResponse) { | |
console.log(httpResponse); | |
response.success("Email sent!"); | |
}, | |
error: function(httpResponse) { | |
console.error(httpResponse); | |
response.error("Uh oh, something went wrong"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment