Using dateTool in email templates

Hello

We are customising the email template “Campaign Template Pre-Generation Notification Email Template” to modify how the generation date looks. We have been told that this email template is a version 2 template.
I am trying to use the __dateTool class as following

#set($testDate = $__dateTool.format('dd/MM/yyyy',${generationDate}))
and then I use the variable in this sentence
Your campaign will be generated on ${testDate}

Has anyone used the __dateTool class before? If yes could you please provide us with examples since the IDN documentation doesn’t really give us examples.
If __dateTool doesn’t work can you propose another solution to format the date using the same format (dd/MM/yyyy)

Regards,
Nadim

Hi @Nadim

Not sure about __dateTool availability in Email Templates.

As an alternative, try to use Apache Velocity Script DateTool class.

Thanks
Krish

Hello Krishna,

Can you provide some examples on the syntax?

Regards,
Nadim

https://velocity.apache.org/tools/2.0/apidocs/org/apache/velocity/tools/generic/DateTool.html

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.