Skip to content

Commit

Permalink
add v3.1 description
Browse files Browse the repository at this point in the history
  • Loading branch information
eboisgon committed May 22, 2017
1 parent a428da9 commit ab21bbd
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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]'}]})

```

Expand Down

0 comments on commit ab21bbd

Please sign in to comment.