Skip to content

Commit

Permalink
fix: condition
Browse files Browse the repository at this point in the history
  • Loading branch information
scmmishra committed May 9, 2024
1 parent a8106f5 commit 26cebce
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/canned.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,12 @@ export const getMessageVariables = ({
return acc;
}, {});

let contactCustomAttributeVariables = {};

if (
contactCustomAttributes &&
Object.keys(contactCustomAttributes).length === 0
) {
contactCustomAttributeVariables = Object.entries(
contactCustomAttributes
).reduce((acc: CustomAttributes, [key, value]) => {
acc[`contact.custom_attribute.${key}`] = value;
return acc;
}, {});
}
const contactCustomAttributeVariables = Object.entries(
contactCustomAttributes ?? {}
).reduce((acc: CustomAttributes, [key, value]) => {
acc[`contact.custom_attribute.${key}`] = value;
return acc;
}, {});

const variables = {
...standardVariables,
Expand Down

0 comments on commit 26cebce

Please sign in to comment.