diff --git a/README.md b/README.md
index 1dd947469..4c0aa94cd 100644
--- a/README.md
+++ b/README.md
@@ -241,7 +241,7 @@ email.setSubstitutions({keep: ['secret'], other: ['one', 'two']}); // sub = {kee
```javascript
var email = new sendgrid.Email();
-email.addSection({'-charge-': 'This ship is useless.'}); // section = {'-charge-': 'This ship is useless.'}
+email.addSection('-charge-', 'This ship is useless.'); // section = {'-charge-': 'This ship is useless.'}
```
#### setSections
diff --git a/lib/email.js b/lib/email.js
index 9fb57e32d..022ad3022 100644
--- a/lib/email.js
+++ b/lib/email.js
@@ -103,8 +103,8 @@ Email.prototype.setCategories = function(val) {
this.smtpapi.setCategories(val);
};
-Email.prototype.addSection = function(object_literal) {
- this.smtpapi.addSection(object_literal);
+Email.prototype.addSection = function(key, val) {
+ this.smtpapi.addSection(key, val);
};
Email.prototype.setSections = function(object_literal) {
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index f5b0182ba..b8cbac4ca 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "sendgrid",
- "version": "1.2.1",
+ "version": "1.2.2",
"dependencies": {
"lodash": {
"version": "2.0.0",
diff --git a/package.json b/package.json
index e1f7b53e2..0afede3a2 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,7 @@
],
"name": "sendgrid",
"description": "Official SendGrid NodeJS library.",
- "version": "1.2.1",
+ "version": "1.2.2",
"homepage": "http://sendgrid.com",
"repository": {
"type": "git",
@@ -19,17 +19,17 @@
"node": ">= 0.4.7"
},
"dependencies": {
- "mime": "1.2.9",
- "request": "2.40.0",
- "lodash": "2.0.0",
- "smtpapi": "1.0.3"
+ "mime": "^1.2.9",
+ "request": "^2.40.0",
+ "lodash": "^2.0.0",
+ "smtpapi": "^1.0.3"
},
"devDependencies": {
"dotenv": "0.0.2",
"mocha": ">= 0.9.0",
"chai": ">= 0.1.6",
- "nock": "~0.16.0",
- "sinon": "~1.6.0"
+ "nock": "^0.16.0",
+ "sinon": "^1.6.0"
},
"scripts": {
"test": "./node_modules/.bin/mocha --grep '#skip' --invert",
diff --git a/test/integration/sendgrid.test.js b/test/integration/sendgrid.test.js
index f2f8d4348..154874d23 100644
--- a/test/integration/sendgrid.test.js
+++ b/test/integration/sendgrid.test.js
@@ -390,8 +390,8 @@ describe('SendGrid #skip', function () {
//mail.addTo(setup.multi_to);
email.addSubstitution('-name-', ['Kyle', 'David']);
email.addSubstitution('-meme-', ['-kyleSection-', '-davidSection-']);
- email.addSection({'-kyleSection-': 'I heard you liked batman so I killed your parents'});
- email.addSection({'-davidSection-': 'Metal gear?!!?!!!!eleven'});
+ email.addSection('-kyleSection-', 'I heard you liked batman so I killed your parents');
+ email.addSection('-davidSection-', 'Metal gear?!!?!!!!eleven');
email.html = "Yo -name-!
Here's a meme for you:
-meme-";
sendgrid.send(email, function(err, json) {
expect(err).to.be.null;
diff --git a/test/lib/sendgrid.test.js b/test/lib/sendgrid.test.js
index 7a68eecc3..d2f7fbc32 100644
--- a/test/lib/sendgrid.test.js
+++ b/test/lib/sendgrid.test.js
@@ -15,7 +15,7 @@ describe('SendGrid', function () {
});
it('version should be set', function() {
- expect(sendgrid.version).to.equal("1.2.1");
+ expect(sendgrid.version).to.equal("1.2.2");
});
it('should attach a options object to self', function() {