Permalink
Browse files

Version bump 0.4.4 - setSubject, setText, setHtml

  • Loading branch information...
1 parent 8433763 commit f5bbe3c844536bed297e7e7ae2241555cd590186 @motdotla motdotla committed Nov 7, 2013
Showing with 232 additions and 3 deletions.
  1. +25 −1 README.md
  2. +12 −0 lib/email.js
  3. +171 −0 npm-shrinkwrap.json
  4. +1 −1 package.json
  5. +22 −0 test/lib/email.test.js
  6. +1 −1 test/lib/sendgrid.test.js
View
@@ -35,7 +35,7 @@ Add the following to your `package.json` file:
...
"dependencies": {
...
- "sendgrid": "0.4.3"
+ "sendgrid": "0.4.4"
}
}
```
@@ -202,6 +202,30 @@ email.setFrom('foo@bar.com');
sendgrid.send(email, function(err, json) { });
```
+#### setSubject
+
+```javascript
+var email = new Email();
+email.setFrom('foo@bar.com');
+sendgrid.send(email, function(err, json) { });
+```
+
+#### setText
+
+```javascript
+var email = new Email();
+email.setText('Some text');
+sendgrid.send(email, function(err, json) { });
+```
+
+#### setHtml
+
+```javascript
+var email = new Email();
+email.setHtml('<h1>Some html</h1>');
+sendgrid.send(email, function(err, json) { });
+```
+
#### setHeaders
You can set custom headers.
View
@@ -87,6 +87,18 @@ Email.prototype.setFrom = function(from) {
this.from = from;
};
+Email.prototype.setSubject = function(subject) {
+ this.subject = subject;
+};
+
+Email.prototype.setText = function(text) {
+ this.text = text;
+};
+
+Email.prototype.setHtml = function(html) {
+ this.html = html;
+};
+
/**
* This method is a proxy for the add sub val on the SmtpapiHeaders
*
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -9,7 +9,7 @@
],
"name": "sendgrid",
"description": "A NodeJS implementation of the SendGrid Api.",
- "version": "0.4.3",
+ "version": "0.4.4",
"homepage": "http://sendgrid.com",
"repository": {
"type": "git",
View
@@ -200,6 +200,28 @@ describe('Email', function () {
expect(email.from).to.eql('kyle.partridge@sendgrid.com');
});
+ it('should be possible to setSubject', function() {
+ var email = new Email();
+ expect(email.subject).to.be.empty;
+ email.setSubject('A subject');
+ expect(email.subject).to.eql('A subject');
+ });
+
+ it('should be possible to setText', function() {
+ var email = new Email();
+ expect(email.text).to.be.empty;
+ email.setText('Some text');
+ expect(email.text).to.eql('Some text');
+ });
+
+ it('should be possible to setHtml', function() {
+ var email = new Email();
+ expect(email.html).to.be.empty;
+ email.setHtml('<p>Some html</p>');
+ expect(email.html).to.eql('<p>Some html</p>');
+ });
+
+
describe('files', function() {
it('should support adding attachments via path', function() {
var email = new Email();
@@ -19,7 +19,7 @@ describe('SendGrid', function () {
});
it('version should be set', function() {
- expect(sendgrid.version).to.equal("0.4.3");
+ expect(sendgrid.version).to.equal("0.4.4");
});
it('should attach a options object to self', function() {

0 comments on commit f5bbe3c

Please sign in to comment.