Email header masks

Avatar

Avatar

ChristineVea

Avatar

ChristineVea

ChristineVea

20-12-2019

I am loading personalized mask values for "from name", "reply to address" and "reply to name" & have been able to reference the additional data to populate these values in place of the defaults.   My dilemma is that my client wants to populate with the personalized masks where they are not null and populate with defaults where null. 

I *think* I need to create new content blocks for these but don't know how to create a content block for temp workflow data...  can I write the  if statement with
If ((targetData/fieldname) is empty, 'default content block',(targetData/fieldname)) ??

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

chan2111

Avatar

chan2111

chan2111

08-01-2020

yes you can build your logic in content block as

 

<%

var fieldName = context.targetData.target.fieldname;

var defaultValue = ‘default’;

%>

<%

if (fieldName.length > 0) {%>

   <%=fieldName%>

<%}

else {%>

  <%=defaultValue%>

<%}

%>

 

Please try this out and let me know.

 

 

 

Answers (0)