I have this email script that is working correctly:
#set( $inTimeZone = $date.getTimeZone().getTimeZone('America/New_York') )
#set( $outTimeZone = $date.getTimeZone().getTimeZone('America/New_York') )
#set( $locale = $date.getLocale() )
#set( $myDate = $convert.parseDate($lead.End_Date_Formula__c,'yyyy-MM-dd',$locale,$inTimeZone) )
${date.format('EEEE, MMMM dd, yyyy',$myDate,$locale,$outTimeZone)}
the only thing left is that I want to set the default value, so if the lead.end_date_formula_C is blank, then I want "the end of the month" to appear instead.
Is this on the right track?
#if( ${lead.End_Date_Formula__c} == "" )
#set (
Solved! Go to Solution.
If I want to set it to a phrase if it's empty, do I just put
## End of the month
No, that would be a comment!
You would just put, literally
End of the month
In Velocity, anything not inside a #directive is considered to be plain output.
Please highlight your code using the syntax highlighter so it's readable (choose Java from the dropdown). Then we'll continue.
Sorry, I can't figure out what you're asking me to do. Can you explain?
Meaning click the Syntax Highlighter in the menu.
Got it. I just updated it! Thank you for your help.
#if( $lead.End_Date_Formula__c.isEmpty() )
## whatever you want to do if it's empty
#else
## the regular stuff
#end
If I want to set it to a phrase if it's empty, do I just put
## End of the month
or do I need to write out something to show that it's text I would want to insert in replace of the token.
Basically, if the salesforce field is blank, I want the email script token to insert the default language "the end of the month".
If I want to set it to a phrase if it's empty, do I just put
## End of the month
No, that would be a comment!
You would just put, literally
End of the month
In Velocity, anything not inside a #directive is considered to be plain output.