We have 6 different blocks of code (that we are putting into personalization blocks) that a recipient could receive. How would I code an if/else statement for these (including the 1 generic version = else?). Would it be something like below?
<% if ( targetData.segmentCode == "A" ) { %>
<%@ include view='A' %>
<% if ( targetData.segmentCode == "B" ) { %>
<%@ include view='B' %>
<% } else { %>
<%@ include view='C' %>
<% } %>
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @KristenCo4 ,
<% if (targetData.segmentCode == "A" ) { %>
Insert content here
<% } else if (targetData.segmentCode == "B" ){ %>
Insert content here
<% } else if (targetData.segmentCode == "C" ){ %>
Insert content here
<% } else { %>
Insert content here
<% } %>
Hi @KristenCo4 ,
<% if (targetData.segmentCode == "A" ) { %>
Insert content here
<% } else if (targetData.segmentCode == "B" ){ %>
Insert content here
<% } else if (targetData.segmentCode == "C" ){ %>
Insert content here
<% } else { %>
Insert content here
<% } %>
thank you so much for the quick turnaround!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies