Nesting Tokens
I have a paragraph inside an email that needs to be altered depending on certain lead attributes. I created the following token that successfully changes which paragraph is displayed, however it doesn't fully work.
#if( ${lead.Layer__c}== "Base")
<p>Reach out to your recruiter {{lead.Lead Owner First Name:default=}} @ {{lead.Lead Owner Email Address:default=}}</p>
#else
<p>Nothing catching your eye? <a href="LINK">Click Here</a></p>
#endThe problem is that the paragraph prints into the email like this:
"Reach out to your recruiter {{lead.Lead Owner First Name:default=}} @ {{lead.Lead Owner Email Address:default=}}"
How would I go about making those two bolded tokens actually print their respective values? I thought I could use the #set command at the start of the script token, but that doesn't work.
#set( $firstName== ${lead.Lead Owner First Name})
#set( $email== ${lead.Lead Owner Email Address})
#if( ${lead.Layer__c}== "Base")
<p>Reach out to your recruiter $firstName @ $email</p>
#else
<p>Nothing catching your eye? <a href="LINK">Click Here</a></p>
#end
Trying to preview my email with this token inside of it just breaks the preview window. Velocity Script is fairly new to me, so it's entirely possible I just didn't use the right syntax. Is it possible to do what I'm trying to do here?