Comparing version
@@ -7,27 +7,30 @@ // NODE SDK Test Key | ||
, SparkPost = require('./lib/sparkpost') | ||
, sparky = new SparkPost(key) | ||
, nock = require('nock'); | ||
, sparky = new SparkPost() | ||
, recipients = [ | ||
{ | ||
email: 'test1@test.com' | ||
, transactional: false | ||
, non_transactional: true | ||
, description: 'Test description 1' | ||
}, | ||
{ | ||
email: 'test2@test.com' | ||
, transactional: true | ||
, non_transactional: true | ||
, description: 'Test description 2' | ||
}, | ||
{ | ||
email: 'test3@test.com' | ||
, transactional: true | ||
, non_transactional: false | ||
, description: 'Test description 3' | ||
} | ||
]; | ||
nock('https://api.sparkpost.com') | ||
.post('/api/v1/transmissions') | ||
.reply(422, {}); | ||
sparky.transmissions.send({ | ||
transmissionBody: { | ||
content: { | ||
//from: 'testing@sparkpostbox.com', | ||
subject: 'Oh hey!', | ||
html:'<html><body><h1>Hi John!</h1><p>Jack just shared graph with you</p><p><a href="https://some.url.here/blablabla">View here</a></p></body></html>' | ||
}, | ||
recipients: [ | ||
{address: 'aydrian@sparkpost.com'} | ||
] | ||
} | ||
}, function(err, res) { | ||
sparky.suppressionList.upsert(recipients, function(err, res) { | ||
if (err) { | ||
console.log('Whoops! Something went wrong'); | ||
console.log(err); | ||
console.log(res.body) | ||
} else { | ||
console.log('Woohoo! You just sent your first mailing!'); | ||
console.log(res.body); | ||
console.log('Congrats you can use our client library!'); | ||
} | ||
@@ -34,0 +37,0 @@ }); |
## Change Log | ||
### v1.3.4 (2016/05/10) | ||
- [#144](https://github.com/SparkPost/node-sparkpost/pull/144) Updated bulk suppression list upsert payload (@aydrian) | ||
### v1.3.3 (2016/04/25) | ||
@@ -4,0 +7,0 @@ - [#142](https://github.com/SparkPost/node-sparkpost/pull/142) Upgrade request to 2.72.0 and fix affected test (@artlogic) |
@@ -12,4 +12,4 @@ 'use strict'; | ||
console.log(res.body); | ||
console.log('Congrats you can use our SDK!'); | ||
console.log('Congrats you can use our client library!'); | ||
} | ||
}); |
@@ -12,4 +12,4 @@ 'use strict'; | ||
console.log(res.body); | ||
console.log('Congrats you can use our SDK!'); | ||
console.log('Congrats you can use our client library!'); | ||
} | ||
}); |
@@ -17,4 +17,4 @@ 'use strict'; | ||
console.log(res.body); | ||
console.log('Congrats you can use our SDK!'); | ||
console.log('Congrats you can use our client library!'); | ||
} | ||
}); |
@@ -32,4 +32,4 @@ 'use strict'; | ||
console.log(res.body); | ||
console.log('Congrats you can use our SDK!'); | ||
console.log('Congrats you can use our client library!'); | ||
} | ||
}); |
@@ -18,4 +18,4 @@ 'use strict'; | ||
console.log(res.body); | ||
console.log('Congrats you can use our SDK!'); | ||
console.log('Congrats you can use our client library!'); | ||
} | ||
}); |
@@ -67,3 +67,3 @@ 'use strict'; | ||
options.uri = api; | ||
options.json = toApiFormat(recipient); | ||
options.json = { recipients: toApiFormat(recipient) }; | ||
} else if(!recipient.email) { | ||
@@ -70,0 +70,0 @@ callback(new Error('email is required in the recipient object')); |
{ | ||
"name": "sparkpost", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "A Node.js wrapper for interfacing with your favorite SparkPost APIs", | ||
@@ -5,0 +5,0 @@ "main": "./lib/sparkpost.js", |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
278480
0.96%129
4.03%4620
1.43%