Created
February 3, 2017 13:35
-
-
Save caco0516/766e92687dbc2c8ad79a01ee3039fa68 to your computer and use it in GitHub Desktop.
A little example of how to send emails with MailJet Node.js module.
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
// This calls sends an email to one recipient. | |
var mailjet = require ('node-mailjet') | |
.connect(process.env.MJ_APIKEY_PUBLIC, process.env.MJ_APIKEY_PRIVATE) | |
var request = mailjet | |
.post("send") | |
.request({ | |
"FromEmail": "[email protected]", | |
"FromName": "[email protected]", | |
"Subject": "Bienvenido a Grow POS", | |
"MJ-TemplateID": "103446", | |
"MJ-TemplateLanguage": true, | |
"Recipients": [ | |
{ "Email": "[email protected]" } | |
], | |
"Vars": { | |
"email": "[email protected]" | |
} | |
}); | |
request | |
.on('success', function (response, body) { | |
console.log (response.statusCode, body); | |
}) | |
.on('error', function (err, response) { | |
console.log (response.statusCode, err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment