Skip to content

Commit

Permalink
Version Bump v3.0.2: Added mail helper
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkingserious committed Jun 15, 2016
1 parent 75a3843 commit 03dc070
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

## [3.0.2] - 2016-06-14
### Added
- Added mail helper

## [3.0.1] - 2016-06-14
### Fixed
- Missing index.js
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions lib/sendgrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ module.exports =
SendGrid: SendGrid,
emptyRequest: emptyRequest
}

exports.mailHelper = require('./helpers/mail/mail.js')
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"name": "sendgrid",
"description": "Official SendGrid NodeJS library.",
"version": "3.0.1",
"version": "3.0.2",
"homepage": "https://sendgrid.com",
"repository": {
"type": "git",
Expand Down

0 comments on commit 03dc070

Please sign in to comment.