mailcomposer
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -18,2 +18,3 @@ var Stream = require("stream").Stream, | ||
* <li><b>encoding</b> - forced transport encoding (quoted-printable, base64, 7bit or 8bit)</li> | ||
* <li><b>keepBcc</b> - include Bcc: field in the message headers (default is false)</li> | ||
* </ul> | ||
@@ -424,2 +425,12 @@ * | ||
// BCC | ||
// By default not included, set options.keepBcc to true to keep | ||
if(this.options.keepBcc){ | ||
if(this._message.bcc && this._message.bcc.length){ | ||
[].concat(this._message.bcc).forEach((function(bcc){ | ||
this.addHeader("Bcc", bcc); | ||
}).bind(this)); | ||
} | ||
} | ||
// REPLY-TO | ||
@@ -426,0 +437,0 @@ if(this._message.replyTo && this._message.replyTo.length){ |
{ | ||
"name": "mailcomposer", | ||
"description": "Compose E-Mail messages", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"author" : "Andris Reinman", | ||
@@ -6,0 +6,0 @@ "maintainers":[ |
@@ -43,2 +43,3 @@ # mailcomposer | ||
* **encoding** - sets transfer encoding for the textual parts (defaults to `"quoted-printable"`) | ||
* **keepBcc** - if set to true, includes `Bcc:` field in the message headers. Useful for *sendmail* command. | ||
@@ -45,0 +46,0 @@ ### Simple example |
@@ -85,2 +85,18 @@ var testCase = require('nodeunit').testCase, | ||
test.done(); | ||
}, | ||
"keepBcc off": function(test){ | ||
var mc = new MailComposer(); | ||
mc.setMessageOption({bcc: "andris@node.ee"}); | ||
mc._buildMessageHeaders(); | ||
test.ok(!mc._getHeader("Bcc")); | ||
test.done(); | ||
}, | ||
"keepBcc on": function(test){ | ||
var mc = new MailComposer({keepBcc: true}); | ||
mc.setMessageOption({bcc: "andris@node.ee"}); | ||
mc._buildMessageHeaders(); | ||
test.equal(mc._getHeader("Bcc"), "andris@node.ee"); | ||
test.done(); | ||
} | ||
@@ -87,0 +103,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
537064
2583
255