Skip to content

Commit

Permalink
updated send example on README.md for sandbox option.
Browse files Browse the repository at this point in the history
  • Loading branch information
aydrian committed Feb 12, 2017
1 parent 4c1a8b0 commit 0c18be0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Before using this library, you must have:
npm install sparkpost
```

*Note: Node.js versions 0.10 and 0.12 are no longer supported. For versions < 4, please continue using [sparkpost v1.3.8](https://github.com/SparkPost/node-sparkpost/tree/1.3.8)*
*Note: Node.js versions 0.10 and 0.12 are no longer supported. For versions < 4, please continue using [sparkpost v1.3.8](https://github.com/SparkPost/node-sparkpost/tree/1.3.8)*

## Initialization
**new SparkPost(apiKey[, options])** - Initialization
Expand Down Expand Up @@ -111,17 +111,20 @@ client.get(options)
```

## Send An Email "Hello World" Example
Below is an example of how to send a simple email. Sending an email is known as a *transmission*. By using the send
method on the transmissions service that's available from the SparkPost object you instantiate, you can pass in an
object with all the [transmission attributes](https://developers.sparkpost.com/api/transmissions#header-transmission-attributes)
relevant to the email being sent. The send method will return a promise that will let you know if the email was sent
Below is an example of how to send a simple email. Sending an email is known as a *transmission*. By using the send
method on the transmissions service that's available from the SparkPost object you instantiate, you can pass in an
object with all the [transmission attributes](https://developers.sparkpost.com/api/transmissions#header-transmission-attributes)
relevant to the email being sent. The send method will return a promise that will let you know if the email was sent
successful and if not information about the error that occurred. If a callback is passed, it will be executed.

```javascript
var SparkPost = require('sparkpost');
var client = new SparkPost('<YOUR API KEY>');

client.transmissions.send({
options: {
sandbox: true
},
content: {
from: 'testing@sparkpostbox.com',
subject: 'Hello, World!',
Expand Down

0 comments on commit 0c18be0

Please sign in to comment.