Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Mailjet code samples to match Send API v3.1 config #469

Merged
merged 5 commits into from
Jun 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions appengine/mailjet/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,25 @@ app.get('/', function (req, res) {
// [START hello]
app.post('/hello', function (req, res, next) {
var options = {
// From
FromEmail: 'no-reply@appengine-mailjet-demo.com',
FromName: 'Mailjet Demo',
// To
Recipients: [{ Email: req.body.email }],
// Subject
Subject: 'Hello World!',
// Body
'Text-part': 'Mailjet on Google App Engine with Node.js',
'Html-part': '<h3>Mailjet on Google App Engine with Node.js</h3>'
'Messages': [
{
'From': {
'Email': 'no-reply@appengine-mailjet-demo.com',
'Name': 'Mailjet Pilot'
},
'To': [
{
'Email': req.body.email
}
],
'Subject': 'Your email flight plan!',
'TextPart': 'Mailjet on Google App Engine with Node.js',
'HTMLPart': '<h3>Mailjet on Google App Engine with Node.js</h3>'
}
]
};

var request = Mailjet.post('send').request(options);
var request = Mailjet.post('send', {'version': 'v3.1'}).request(options);

request
.then(function (response, body) {
Expand Down