Hello Everyone,
I have an email which is to be sent periodically, I was wondering if there is a way to automatically fetch the current month/last month/current year. Much like a token would do. I tried to google it but I could only find it could be done using Email Scripting Token.
My email line reads like this:
"Please submit any pending reports for upload for the month of <Last Month>. The last date for submission is 10th, <Current Month> <Current Year>."
Is there any way it can fetch the information automatically.
Thank you in advance.
Harshit
Solved! Go to Solution.
Hi Harshit,
#set($calendar = $date.getCalendar())
$calendar.add(2,-1)
$date.format('MMMM',$calendar)
(come back and mark me as correct if this works for you).
#set($calendar = $date.getCalendar()) //get a calendar
$calendar.add(2,-1) //use the calendar add tool, init month (2) and -1
$date.format('MMMM',$calendar) //display the date in the format MMMM