diff --git a/lib/helpers/mail/mail.js b/lib/helpers/mail/mail.js index 05273e9c4..fd26423c6 100644 --- a/lib/helpers/mail/mail.js +++ b/lib/helpers/mail/mail.js @@ -623,7 +623,13 @@ function Personalization() { this.substitutions = {}; } var currentKey = Object.keys(substitution)[0]; - this.substitutions[currentKey] = substitution[currentKey].toString(); + var currentVal = substitution[currentKey]; + if (currentVal === null || typeof currentVal === 'undefined') { + this.substitutions[currentKey] = ''; + } + else { + this.substitutions[currentKey] = currentVal.toString(); + } }; this.getSubstitutions = function() {