Email conditional content | Community
Skip to main content
March 27, 2024
Solved

Email conditional content

  • March 27, 2024
  • 1 reply
  • 1398 views

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 <%}%>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SatheeskannaK

@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.

1 reply

SatheeskannaK
Community Advisor
SatheeskannaKCommunity AdvisorAccepted solution
Community Advisor
March 27, 2024

@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
o_XAuthor
March 28, 2024

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 <%}%>

 

SatheeskannaK
Community Advisor
Community Advisor
March 28, 2024

@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