Hi,
So I wrote the following velocity script to make a token value to appear in lower case in the email copy:
1. #set ($ptier = ${lead.Partner_Tier__c.toLowerCase()})
$display.capitalize($ptier)
Am using this as a token {{my.Previous_Partner_Tier1}} in my email copy.
2. #set ($pptier = ${lead.Previous_Partner_Tier__c.toLowerCase()})
$display.capitalize($pptier)
Token that I am using in email copy {{my.Previous_Partner_Tier1}}
Yesterday - I did couple of sample tests of the email and it all worked fine.
Today its not working, the tokens are not getting populated with value and are appearing as {{my.Previous_Partner_Tier1}} in the copy itself. Would you know if anything has changed in the velocity email scripting side that I need to update in the script above? or am I missing something?
Solved! Go to Solution.
So here is whats worked for me:
To make a value lowercase and capitalize the first word, you can use the velocity scripting as below:
#set ($ptier = ${lead.Partner_Tier__c.toLowerCase()})
$display.capitalize($ptier)
Note:
* The email preview shows you the token (i.e {{my.Previous_Partner_Tier1}}), rather than the value
* Setting up default value for the velocity token resulted in errors, so I haven't put one in
* You can do sample send, but better to test it by doing a email send using a smart campaign and I could see the values populated accurately.
* One prob is that I can see a "space" in the email copy next to wherever the values are now - which needs to be "trimmed". I'll update you if I am able to resolve this one.