Hello,
I've started using velocity scripts in my emails however once I try to save the email I get an error validation message.
Has anyone had similar issues previously?
Solved! Go to Solution.
Please use #set and not #Set, and similarly use #end and not #End. The keywords in the velocity script are case-sensitive. Additionally, instead of using == use equals() as it's more robust.
#if($lead.currentPage.equals("www.example.com"))
#set($content = "This is a test")
${content}
#end
Make sure you've check-marked the custom field "Current Page" that you're using in your script, and additionally, you also want to ensure that the field name that you're using in the script matches with what you see when you pull the variable from the field selector to the code editor (snapshot below).
Please use #set and not #Set, and similarly use #end and not #End. The keywords in the velocity script are case-sensitive. Additionally, instead of using == use equals() as it's more robust.
#if($lead.currentPage.equals("www.example.com"))
#set($content = "This is a test")
${content}
#end
Make sure you've check-marked the custom field "Current Page" that you're using in your script, and additionally, you also want to ensure that the field name that you're using in the script matches with what you see when you pull the variable from the field selector to the code editor (snapshot below).