I am trying to use this script:
2 3 4 5 | #set ($fname = ${lead.FirstName}) #if($fname.equals("")) #else Hello ${lead.FirstName}), #end |
Shared by Jenna Molby on here site here 4 Examples of Velocity Email Scripting in Marketo
Unfortunately it is not working for me - this is what I get in attached screenshot.
I noticed that there seemed to be an extra paran at the end of line 5 - removed it and ended up with the exact same result minus the pareb
The code is needlessly complex. I feel like people (not singling you out) don't understand that Velocity objects are Java wrappers, so they support the same chaining that Java does, and you don't need all kinds of intermediate variables.
#if (!$lead.FirstName.isEmpty())
Hello ${lead.FirstName}
#end
You have the $ and { swapped in your image. Flip their positions and it should work.
(saw that too)
Awesome - thanks for the help!
Sanford - thanks for simplifying things