Expand my Community achievements bar.

SOLVED

Email header masks

Avatar

Level 2

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)) ??

1 Accepted Solution

Avatar

Correct answer by
Level 4

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.

 

 

 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 4

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.