1
0
mirror of https://github.com/eleith/emailjs.git synced 2024-07-05 20:10:37 +00:00

fixes #195. allows empty text message in the body

This commit is contained in:
eleith 2017-07-16 16:27:44 -07:00
parent de85773709
commit 20f72b9682
2 changed files with 27 additions and 1 deletions

View File

@ -85,7 +85,7 @@ Client.prototype =
if(!(msg instanceof message.Message)
&& msg.from
&& (msg.to || msg.cc || msg.bcc)
&& (msg.text || this._containsInlinedHtml(msg.attachment)))
&& (msg.text !== undefined || this._containsInlinedHtml(msg.attachment)))
msg = message.create(msg);
if(msg instanceof message.Message)

View File

@ -82,6 +82,32 @@ describe("messages", function()
}, done);
});
it('null text', function(done) {
send({
subject: "this is a test TEXT message from emailjs",
from: "zelda@gmail.com",
to: "gannon@gmail.com",
text: null,
"message-id": "this is a special id"
}, function(mail)
{
expect(mail.text).to.equal("\n\n");
}, done);
});
it('empty text', function(done) {
send({
subject: "this is a test TEXT message from emailjs",
from: "zelda@gmail.com",
to: "gannon@gmail.com",
text: "",
"message-id": "this is a special id"
}, function(mail)
{
expect(mail.text).to.equal("\n\n");
}, done);
});
it("simple unicode text message", function(done)
{
var message =