Skip to content

Commit 3e41de2

Browse files
Atanas DamyanlievJustinBeckwith
authored andcommitted
fix: Updating Mailjet code samples to match Send API v3.1 config (#469)
1 parent 65f6908 commit 3e41de2

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

appengine/mailjet/app.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,25 @@ app.get('/', function (req, res) {
4545
// [START hello]
4646
app.post('/hello', function (req, res, next) {
4747
var options = {
48-
// From
49-
FromEmail: '[email protected]',
50-
FromName: 'Mailjet Demo',
51-
// To
52-
Recipients: [{ Email: req.body.email }],
53-
// Subject
54-
Subject: 'Hello World!',
55-
// Body
56-
'Text-part': 'Mailjet on Google App Engine with Node.js',
57-
'Html-part': '<h3>Mailjet on Google App Engine with Node.js</h3>'
48+
'Messages': [
49+
{
50+
'From': {
51+
'Email': '[email protected]',
52+
'Name': 'Mailjet Pilot'
53+
},
54+
'To': [
55+
{
56+
'Email': req.body.email
57+
}
58+
],
59+
'Subject': 'Your email flight plan!',
60+
'TextPart': 'Mailjet on Google App Engine with Node.js',
61+
'HTMLPart': '<h3>Mailjet on Google App Engine with Node.js</h3>'
62+
}
63+
]
5864
};
5965

60-
var request = Mailjet.post('send').request(options);
66+
var request = Mailjet.post('send', {'version': 'v3.1'}).request(options);
6167

6268
request
6369
.then(function (response, body) {

0 commit comments

Comments
 (0)