SOLVED

Can I use a my.token rich text as defined by a velocity script?

Go to solution
Will_Thomas
Level 3

Can I use a my.token rich text as defined by a velocity script?

I'm trying to create a dynamic content email, where it will use one of a few different rich text my.tokens to populate the content based on variables.

I am defining the variables in one velocity token:

#define( $FocusArea1NoInterest )

{{my.FocusArea1NoInterest}}

#end

#define( $FocusArea1LowInterest )

{{my.FocusArea1LowInterest}}

#end

#define( $FocusArea1HighInterest )

{{my.FocusArea1HighInterest}}

#end

Then in the next token, I am using variables to determine which output to use:

#if (${lead.FocusArea1} == "High")

   #set ($Dynamic1Text0 = $FocusArea1HighInterest)

#elseif (${lead.FocusArea1} == "Low")

   #set ($Dynamic1Text0 = $FocusArea1LowInterest)

#else

   #set ($Dynamic1Text0 = $FocusArea1NoInterest)

#end

Using these two I was able to make $Dynamic1Text0 output {{my.FocusArea1NoInterest}} into an email, but not the rich text contents of that my.token itself.  Is it possible to use the velocity here to actually pick which rich text my token to use?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Can I use a my.token rich text as defined by a velocity script?

You can't pair VTL and non-VTL tokens this way.

You can however use VTL to determine whether to output HTML comment tags around non-VTL tokens, which is a way of accomplishing the same visible content.

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Can I use a my.token rich text as defined by a velocity script?

You can't pair VTL and non-VTL tokens this way.

You can however use VTL to determine whether to output HTML comment tags around non-VTL tokens, which is a way of accomplishing the same visible content.

Will_Thomas
Level 3

Re: Can I use a my.token rich text as defined by a velocity script?

The reason I was using Velocity was because we want to be able to randomize the order of dynamic content, as well.  I was essentially trying to recreate segmentations here, so that I could use the velocity randomizer (which you created here Lightweight A/B testing using Velocity ) to determine the order of the content.  At this point though, it seems like I should just make one newsletter using segmentations for content, and then clone a few versions and manually change the order of the modules.

SanfordWhiteman
Level 10 - Community Moderator

Re: Can I use a my.token rich text as defined by a velocity script?

Yeah, suppressing content with comments is one thing, reordering is another!

Unless you move your content into Velocity (meaning no Rich Text Wysiyg editor) you won't be able to do what you describe.

Will_Thomas
Level 3

Re: Can I use a my.token rich text as defined by a velocity script?

Exactly.  I'm trying to make this simple enough that my whole team can use it with little issue, which I could have done using my tokens.  At this point though, sounds like a wash.  Thanks anyways, I've been referencing your comments about velocity all over the forum.