Expand my Community achievements bar.

SOLVED

Email conditional content

Avatar

Level 3
Level 3

I want to add conditions to display certain text based on if a workflow target field is 0 or 1, how can I perform this directly in the html code rather than going through the native feaure which adds a lot of junk.

For the following line item, i want to just display the character code ☑ if a boolean condition is true.

<li><span style="font-size: 18px;">&#9745; 1 year Member </span></li>

 When I apply Dynamic Text, look at all the junk thats added

<li><span style="font-size: 18px;"><span id="171152985185690" class="nl-dce-multiconditional nl-dce-if nl-dce-variant nl-dce-variant-text nl-dce-current-variant" data-nl-condition-type="multiple_text" data-nl-variant-group="171152985186532" data-nl-expr="/*@nlLabel isMember*/(context.targetData.isMember=== true)" data-nl-variant-index="1" data-nl-variant-desc="isMember">☑</span><span id="171152985185690" class="nl-dce-multiconditional nl-dce-if nl-dce-variant nl-dce-variant-text" data-nl-condition-type="multiple_text" data-nl-variant-group="171152985186532" data-nl-variant-default="true" data-nl-variant-label="Default" data-nl-expr="" data-nl-variant-index="0">☑</span> Membership for 1 year </span></li>

 Is it not possible to use condition syntax like adobe campaign classic?

<% if (targetData.isMember === true) { %> Is Member <%}%>
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@o_X, When you use ACS email designer it will automatically add additional necessary elements to display the content. Either you can import your own HTML or use the import HTML using the URL option. I would suggest content blocks for easy maintenance and refer to the content block for dynamic conditions in the email template by retaining the ACS email designer capabilities.

Thanks, Sathees

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

@o_X, When you use ACS email designer it will automatically add additional necessary elements to display the content. Either you can import your own HTML or use the import HTML using the URL option. I would suggest content blocks for easy maintenance and refer to the content block for dynamic conditions in the email template by retaining the ACS email designer capabilities.

Thanks, Sathees

Avatar

Level 3
Level 3

Hey Sath, 

Thanks for your insight, I am still confused,

Is it possible or not to use my own conditional syntax in the html code? raher than using the conditional text featture.

<% if (context.targetData.isMember === true) { %> Is Member <%}%>

 

Avatar

Community Advisor

@o_X, Yes, you should be able to use that directly in the HTML. Examples here,


<%= context.targetData.firstname %>

 
<% if (context.targetData.firstname != '') { %> success <%} %>
 
Thanks, Sathees