Send Sample shouldn't be used to test Velocity... send real emails.
Or the 'Preview Email / View by Lead' function.
(when this is the most helpful thing you can add to a thread because the rest has been covered off so thoroughly)
Thanks Nicholas,
Actually I didn't know that this was possible. I used to use this feature in Mailchimp, very helpful.
Have a great day,
Thomas
Good day Sanford,
May I disturb you once more to ask if this is the way you would proceed to personalize a subject line? Thanks!
Thomas
#if(!$lead.FirstName.isEmpty())
#set($subject = "$lead.FirstName, beat grocery stores at their own game with our new hit app")
#else
#set($subject = "Beat grocery stores at their own game with our new hit app")
#end
${subject}
Sure, LGTM. The only thing I might change is change to ${formal.notation} in the #set. FN tends to be overused in comparisons and when calling methods -- and can actually break stuff there, as we've seen. But it's underused within quotation marks, where it adds clarity and is a net good.
Thanks Sanford, I changed the notation between quotation marks accordingly.
Thomas
Do you put the java script directly in the source code of the email you are working with?
Not JavaScript: Velocity (VTL)! Very, very different.
As I mentioned on your other thread, VTL goes in a token. Then the token name goes in your email.
Sanford, awesome work.
Question - can you put tokens inside a script token?
Example.
If foo = bar
token = {{my.token1}}
else
token = {{my.token2}}
Or does Marketo not evaluate tokens inside tokens?
Generic text/HTML tokens, no.
Other Velocity token values, yes (though you don't need to reference them as {{my.tokens}} but as simple Velocity vars).
When you use Velocity a lot, you tend to stop using text tokens and instead work in VTL semi-exclusively. For example, instead of a text token
twitter.com/ourprimaryhandle
you have a Velocity token
#set( $globals = {
"twitterHandle" : "twitter.com/ourprimaryhandle",
"facebookPage" : "facebook.com/ourpage"
} )
Then include the {{my.globals}} token (in the template, typically) and you have access to to $globals.twitterHandle in any subsequent script.