Works great for this format: Monday, February 27, 2017
#set( $inTimeZone = $date.getTimeZone().getTimeZone('America/Chicago') )
#set( $outTimeZone = $date.getTimeZone().getTimeZone('America/Chicago') )
#set( $locale = $date.getLocale() )
#set( $myDate = $convert.parseDate($lead.contractDate,'yyyy-MM-dd',$locale,$inTimeZone) )
${date.format('EEEE, MMMM dd, yyyy',$myDate,$locale,$outTimeZone)}
Sure, that looks like my go-to code there.
The line that begins
${date.format(...
uses variables declared earlier ($myDate, $locale, etc.).
Sanford Whiteman I'm getting a nasty error when I use this:
Why can't I be as smart as you?!?! I just want to know the answer!!
#set( $inTimeZone = $date.getTimeZone().getTimeZone('America/Chicago') )
#set( $outTimeZone = $date.getTimeZone().getTimeZone('America/Chicago') )
#set( $locale = $date.getLocale() )
#set( $myDate = $convert.parseDate($lead.contractDate,'yyyy-MM-dd',$locale,$inTimeZone)
${date.format('d MMMM yyyy',$myDate,$locale,$outTimeZone)}
You put the code in an Email Script (Velocity) token, right?
Hi Sanford, Yes the velocity email script token was used, just replaced the code.
Can you show me a screenshot of the Email Script Editor with your code in it?
And you're sure (a) you have Contract Date selected in the right-hand tree and (b) that its VTL variable name is $lead.contractName? I would expect it to be $lead.Contract_Name given Velocity naming conventions.
the Contract Date field value is: ${lead.contractDate}
this is the current script for this format: Monday, February 27, 2017 I replaced the error script so that I can get this email out as it's a rush for today