-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,19 +197,19 @@ sendEmail | |
``` javascript | ||
var emailData = { | ||
'FromEmail': '[email protected]', | ||
'FromEmail': '[email protected]', | ||
'FromName': 'Guillaume badi', | ||
'Subject': 'Coucou Mailjet2', | ||
'Text-part': 'Hello World2', | ||
'Recipients': [{'Email': 'gbadi@mailjet.com'}], | ||
'Recipients': [{'Email': 'passenger@mailjet.com'}], | ||
}; | ||
var emailData2 = { | ||
'FromEmail': '[email protected]', | ||
'FromEmail': '[email protected]', | ||
'FromName': 'Guillaume badi', | ||
'Subject': 'Coucou Mailjet2', | ||
'Text-part': 'This is another Email', | ||
'Recipients': [{'Email': 'gbadi@mailjet.com'}], | ||
'Recipients': [{'Email': 'passenger@mailjet.com'}], | ||
}; | ||
sendEmail | ||
|
@@ -261,7 +261,18 @@ testEmail('Hello World!'); | |
npm test | ||
``` | ||
|
||
## Use the version 3.1 of the send API | ||
## New !! Version 3.1.0 of the Nodejs wrapper ! | ||
|
||
This version modifies the way to construct the Client or the calls. We add the possibility to add an array with parameters on both Client creation and API call (please, note that each of these parameters are preset and are not mandatory in the creation or the call) : | ||
|
||
Properties of the $settings (Client constructor) and $options (API call function) | ||
|
||
url (Default: api.mailjet.com) : domain name of the API | ||
version (Default: v3) : API version (only working for Mailjet API V3 +) | ||
perform_api_call (Default: true) : turns on(true) / off the call to the API | ||
secured (Default: true) : turns on(true) / off the use of 'https' | ||
|
||
|
||
|
||
``` javascript | ||
|
||
|
@@ -277,18 +288,14 @@ const mailjet = require ('apiv3') | |
// the second argument (the object) is not mandatory, as each of its 4 keys | ||
const request = mailjet | ||
.post("send", { | ||
'url': 'api.mailjet.com', 'version': 'v3.1', 'secured': 'https', 'perform_api_call': false | ||
'url': 'api.mailjet.com', 'version': 'v3', 'secured': 'https', 'perform_api_call': false | ||
}) | ||
.request({ | ||
"Messages": [{ | ||
"From":{"Email":"[email protected]", "Name": "mailjet pilot"}, | ||
"Subject":"Test from NodeJS wrapper", | ||
"TextPart":"Dear passenger, welcome to Mailjet! May the delivery force be with you!", | ||
"HTMLPart":"<h3>Dear passenger, welcome to Mailjet!</h3><br />May the delivery force be with you!", | ||
"To":[{"Email":"[email protected]"}] | ||
}] | ||
}) | ||
'FromEmail': '[email protected]', | ||
'FromName': 'Pilot', | ||
'Subject': 'Coucou Mailjet2', | ||
'Text-part': 'Hello World2', | ||
'Recipients': [{'Email': '[email protected]'}]}) | ||
|
||
``` | ||
|
||
|