Skip to content

Commit

Permalink
Fixing broken build for #689
Browse files Browse the repository at this point in the history
  • Loading branch information
therajumandapati committed May 30, 2018
1 parent e477405 commit 2abbbce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/helpers/classes/mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Mail {
//Convert to camel case to make it workable, making a copy to prevent
//changes to the original objects
data = deepClone(data);
data = toCamelCase(data, ['substitutions', 'customArgs', 'headers']);
data = toCamelCase(data, ['substitutions', 'dynamicTemplateData', 'customArgs', 'headers']);

//Extract properties from data
const {
Expand Down Expand Up @@ -587,7 +587,7 @@ class Mail {
}

//Return as snake cased object
return toSnakeCase(json, ['substitutions', 'customArgs', 'headers']);
return toSnakeCase(json, ['substitutions', 'dynamicTemplateData', 'customArgs', 'headers']);
}

/**************************************************************************
Expand Down
5 changes: 3 additions & 2 deletions packages/helpers/classes/personalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,15 @@ class Personalization {
if (Object.keys(headers).length > 0) {
json.headers = headers;
}
if (Object.keys(substitutions).length > 0) {
if (substitutions && Object.keys(substitutions).length > 0) {
const [left, right] = substitutionWrappers;
json.substitutions = wrapSubstitutions(substitutions, left, right);
}
if (Object.keys(customArgs).length > 0) {
json.customArgs = customArgs;
}
if (Object.keys(dynamicTemplateData).length > 0) {

if (dynamicTemplateData && Object.keys(dynamicTemplateData).length > 0) {
json.dynamicTemplateData = dynamicTemplateData;
}

Expand Down

0 comments on commit 2abbbce

Please sign in to comment.