I have set up a script that I want to use to print content as and when people have a certain email domain as the below.
It defaults to the 'else' even when the users email is xxxx.yyyy@1234.com
What have I got wrong??
#if ($lead.email.contains("@1234.com"))
<p style="font-size:22px">The following message is for @xxxx.com only domains</p>
#else
#end
Solved! Go to Solution.
To use a field in Velocity, check it off in the tree on the right hand side of Script Editor. This also lets you drag the the field to the canvas, which will show your error (a typo in the field name).
Finally, you should be using endsWith
(https://docs.oracle.com/javase/6/docs/api/java/lang/String.html).
To use a field in Velocity, check it off in the tree on the right hand side of Script Editor. This also lets you drag the the field to the canvas, which will show your error (a typo in the field name).
Finally, you should be using endsWith
(https://docs.oracle.com/javase/6/docs/api/java/lang/String.html).