-
Notifications
You must be signed in to change notification settings - Fork 782
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version Bump v3.0.2: Added mail helper
- Loading branch information
1 parent
75a3843
commit 03dc070
Showing
4 changed files
with
13 additions
and
7 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
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 |
---|---|---|
|
@@ -74,15 +74,15 @@ npm install sendgrid | |
## Hello Email | ||
|
||
```javascript | ||
var helper = require('sendgrid-nodejs').helper | ||
var helper = require('sendgrid').mailHelper | ||
|
||
from_email = new helper.Email("[email protected]") | ||
to_email = new helper.Email("[email protected]") | ||
subject = "Hello World from the SendGrid Node.js Library" | ||
content = new helper.Content("text/plain", "some text here") | ||
mail = new helper.Mail(from_email, subject, to_email, content) | ||
|
||
var sg = require('sendgrid-nodejs').SendGrid(process.env.SENDGRID_API_KEY) | ||
var sg = require('sendgrid').SendGrid(process.env.SENDGRID_API_KEY) | ||
|
||
var requestBody = mail.toJSON() | ||
var request = sg.emptyRequest() | ||
|
@@ -99,13 +99,13 @@ npm install sendgrid | |
## General v3 Web API Usage | ||
|
||
```javascript | ||
var sg = require('sendgrid-nodejs').SendGrid(process.env.SENDGRID_API_KEY) | ||
var sg = require('sendgrid').SendGrid(process.env.SENDGRID_API_KEY) | ||
|
||
// GET Collection | ||
var request = sg.emptyRequest() | ||
requestGet.method = 'GET' | ||
requestGet.path = '/v3/api_keys' | ||
sg.API(requestGet, function (response) { | ||
request.method = 'GET' | ||
request.path = '/v3/api_keys' | ||
sg.API(request, function (response) { | ||
console.log(response.statusCode) | ||
console.log(response.body) | ||
console.log(response.headers) | ||
|
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 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