Skip to content

Commit

Permalink
Merge pull request #438 from adamreisnz/issue-435
Browse files Browse the repository at this point in the history
Content is not mandatory
  • Loading branch information
thinkingserious authored Aug 31, 2017
2 parents 2762c23 + a441349 commit faaa3e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/helpers/classes/mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ class Mail {

//Initialize with mandatory values
const json = {
from, subject, content,
from, subject,
personalizations: arrayToJSON(personalizations),
};

Expand All @@ -497,6 +497,9 @@ class Mail {
if (Array.isArray(categories) && categories.length > 0) {
json.categories = categories.filter(cat => cat !== '');
}
if (Array.isArray(content) && content.length > 0) {
json.content = arrayToJSON(content);
}

//Object properties
if (Object.keys(headers).length > 0) {
Expand Down

0 comments on commit faaa3e8

Please sign in to comment.