Skip to main content
Richard_Teta
Level 1
August 9, 2017
Question

Conditional Logic for Tokens

  • August 9, 2017
  • 2 replies
  • 2669 views

Inside of an email can you introduce conditional logic when inserting a Token?

For instance:

When the value of token is 1 then write "Male".

When the value of token is 2 then write "Female".

Is this possible?

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Jim_Thao7
Level 8
August 9, 2017

Out of the box, you can do this with dynamic content (segmentation).  You will need to build out the infrastructure for it, such as the segments/segmentation.  Then, you can segment the email accordingly.

If you want a more straight forward approach and are good with code, look into Velocity which can easily do this. 

Eric_Salamon1
Level 6
August 10, 2017

There are many ways to approach that issue. Personally, I started learning Velocity scripting today just to overcome an if statement issue.

SanfordWhiteman
Level 10
August 11, 2017

Yep, I would totally recommend Velocity over Segmentations for this. Anytime you're managing what can be single words in a content block, you don't want to have to use full-fledged Dynamic Content™.