smtpapi
Advanced tools
Comparing version 1.1.0 to 1.2.0
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
## [1.2.0] - 2015-7-19 | ||
### Added | ||
- IP Pool support | ||
## [1.1.0] - 2015-2-3 | ||
@@ -8,2 +12,1 @@ ### Added | ||
- CHANGELOG.md | ||
@@ -20,2 +20,3 @@ (function() { | ||
this.header.asm_group_id = header.asm_group_id || {}; | ||
this.header.ip_pool = header.ip_pool || ''; | ||
}; | ||
@@ -114,2 +115,6 @@ | ||
smtpapi.prototype.setIpPool = function(ip_pool) { | ||
this.header.ip_pool = ip_pool; | ||
}; | ||
smtpapi.prototype.jsonObject = function() { | ||
@@ -119,3 +124,4 @@ var header = {}; | ||
if (this.header.hasOwnProperty(key) && (typeof this.header[key] === 'object' && Object.keys(this.header[key]).length) || | ||
typeof this.header[key] === 'number' && this.header[key]) { | ||
typeof this.header[key] === 'number' && this.header[key] || | ||
typeof this.header[key] === 'string' && this.header[key]) { | ||
header[key] = this.header[key]; | ||
@@ -122,0 +128,0 @@ } |
{ | ||
"name": "smtpapi", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Build SendGrid X-SMTPAPI headers in nodejs.", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
@@ -30,3 +30,3 @@ # smtpapi-nodejs | ||
... | ||
"smtpapi": "1.1.0" | ||
"smtpapi": "1.2.0" | ||
} | ||
@@ -199,2 +199,8 @@ } | ||
### [IP Pools](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_pools.html) | ||
```javascript | ||
header.setIpPool("testPool"); | ||
``` | ||
## SendGrid SMTP Example | ||
@@ -201,0 +207,0 @@ |
@@ -12,3 +12,3 @@ var assert = require('assert'); | ||
it('version should be set', function() { | ||
header.version.should.eql("1.1.0"); | ||
header.version.should.eql("1.2.0"); | ||
}); | ||
@@ -132,2 +132,7 @@ | ||
}); | ||
it('setIpPool', function() { | ||
header.setIpPool('testPool'); | ||
header.jsonString().should.eql(t.set_ip_pool); | ||
}); | ||
}); |
@@ -20,3 +20,4 @@ { | ||
"add_send_each_at": "{\"send_each_at\":[1409348513,1409348514,1409348515]}", | ||
"set_asm_group_id": "{\"asm_group_id\":123}" | ||
"set_asm_group_id": "{\"asm_group_id\":123}", | ||
"set_ip_pool": "{\"ip_pool\":\"testPool\"}" | ||
} |
17017
256
265