# Using dateTool in email templates

**URL:** <https://developer.sailpoint.com/discuss/t/using-datetool-in-email-templates/18070>\
**Category:** SHF Discussion and Questions\
**Tags:** email-templates, sailpoint-identity-security\
**Created:** [September 22, 2023, 8:47am UTC](https://developer.sailpoint.com/discuss/t/using-datetool-in-email-templates/18070 "2023-09-22T08:47:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nadim](https://avatars.discourse-cdn.com/v4/letter/n/9dc877/32.png) [@Nadim](https://developer.sailpoint.com/discuss/u/Nadim)\
**Post date:** [September 22, 2023, 8:47am UTC](https://developer.sailpoint.com/discuss/t/using-datetool-in-email-templates/18070/1 "2023-09-22T08:47:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KRM7](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/krm7/32/2685_2.png) [@KRM7](https://developer.sailpoint.com/discuss/u/KRM7)\
**Post date:** [September 22, 2023, 10:38am UTC](https://developer.sailpoint.com/discuss/t/using-datetool-in-email-templates/18070/2 "2023-09-22T10:38:52Z")

</div>

Hi @Nadim

Not sure about \_\_dateTool availability in Email Templates.

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

Thanks  
Krish

---

<div class="post-metadata">

**Author:** ![Nadim](https://avatars.discourse-cdn.com/v4/letter/n/9dc877/32.png) [@Nadim](https://developer.sailpoint.com/discuss/u/Nadim)\
**Post date:** [September 22, 2023, 12:11pm UTC](https://developer.sailpoint.com/discuss/t/using-datetool-in-email-templates/18070/3 "2023-09-22T12:11:32Z")

</div>

Hello Krishna,

Can you provide some examples on the syntax?

Regards,  
Nadim

---

<div class="post-metadata">

**Author:** ![KRM7](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/krm7/32/2685_2.png) [@KRM7](https://developer.sailpoint.com/discuss/u/KRM7)\
**Post date:** [September 22, 2023, 2:53pm UTC](https://developer.sailpoint.com/discuss/t/using-datetool-in-email-templates/18070/4 "2023-09-22T14:53:15Z")

</div>

[https://velocity.apache.org/tools/2.0/apidocs/org/apache/velocity/tools/generic/DateTool.html](https://velocity.apache.org/tools/2.0/apidocs/org/apache/velocity/tools/generic/DateTool.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [November 21, 2023, 2:53pm UTC](https://developer.sailpoint.com/discuss/t/using-datetool-in-email-templates/18070/5 "2023-11-21T14:53:48Z")

</div>

Closed on November 21, 2023, 2:53pm UTC

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