Expand my Community achievements bar.

SOLVED

Message Center Conditional Formatting - Campaign V8

Avatar

Level 5

Hello,

 

Is it possible to use conditional HTML formatting in a Transactional Email Template based off of an RT event value?

 

I've been testing with something basic like this:

 

<% if ( <%= rtEvent.ctx.email.@type %> == 'Order' ) { %>Your Order is en route<% } %><% else { %>Your Order is delayed<% } %>

 

I'm testing based on proofs with a seed address that has the following two CTX values: 

<ctx>
<email location="somewhere" type="Order"/>
</ctx>

 

 

When I analyze a proof to send, it shows an error around htmlContent -- so I'm wondering if this is just not available functionality in message center. But maybe (hopefully), I'm just doing something wrong.

 

What do you think?

 

Thanks!

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @robertc66522596 ,

You can use conditional statement in message center.

Modify your conditional statement as below,

<% if ( rtEvent.ctx.email.@type == 'Order' ) { %>
Your Order is en route
<% } else { %>
Your Order is delayed
<% } %>

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @robertc66522596 ,

You can use conditional statement in message center.

Modify your conditional statement as below,

<% if ( rtEvent.ctx.email.@type == 'Order' ) { %>
Your Order is en route
<% } else { %>
Your Order is delayed
<% } %>

Avatar

Level 5

Thank you ParthaSarathy!

 

That did the trick. I figured i needed those additional <% to get the RT event marker, good to know I do not.

 

Thank you!