AnsweredAssumed Answered

Email Script - construct variable names dynamically in velocity

Question asked by 8f24e31b5a40162b5242563934bcc77bc6c7650a on Dec 15, 2016
Latest reply on Dec 15, 2016 by sanford.whiteman

Hello

 

I wanted to know if there is an expression in order to do this:

 

#set( $TP = ["TP_A", "TP_B"])

#set( $TP_A = ["Button A", "https://www.wonderfulworld.com"])

#set( $TP_B = [@"Button B", "https://www.hellworld.com"])

 

#foreach( $asset in $TP )

     #if($lead.notengagedAssets.matches("(?i)(.*)(^|;)\s*${asset}\s*(;|$)(.*)") )

          <a href="${${asset}[1]}">${${asset}[0]}</a>

          ##I want to get the label out of the ${asset} variable and add the [...] to indicate which parameters to retreive.

     #end

#end

 

##The result expected should be:

          <a href="https://www.wonderfulworld.com">Button A</a>

          <a href="https://www.hellworld.com">Button B</a>

 

Is it possible? would it mess with the email click tracking of Marketo?

 

BR,

Charles

Outcomes