Re: Conditional Logic for Tokens

Richard_Teta
Level 1

Conditional Logic for Tokens

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

3 REPLIES 3
Jim_Thao7
Level 9

Re: Conditional Logic for Tokens

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

Re: Conditional Logic for Tokens

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 - Community Moderator

Re: Conditional Logic for Tokens

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