Skip to content

Commit c68e7d7

Browse files
Merge pull request #391 from hpaul/patch-1
Return personalizations as an array of request compatible JSON.
2 parents 4af67b1 + 7dc8567 commit c68e7d7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/helpers/mail/mail.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,9 +723,11 @@ function Mail(from_email, subject, to_email, content) {
723723
}
724724
this.personalizations.push(personalization);
725725
};
726-
726+
// This array must be JSON compatible with the raw sendgrid request
727727
this.getPersonalizations = function() {
728-
return this.personalizations;
728+
return this.personalizations.map(function(personalization) {
729+
return personalization.toJSON();
730+
});
729731
};
730732

731733
this.setSubject = function(subject) {

0 commit comments

Comments
 (0)