function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
frogfrog 

formated date in attachment's name of VF email template

I have a little problem. I need to send daily email from workflow.
The email contains attachment and the requirement is the name of the file must contain current date in YYYYMMdd format.
The file's content is generated in custom component located between <messaging:attachment> tags

How can I easily achive this?
I know  one can format dates in output text but it's not my case.
Everything I can think of now looks like an overkill for something so simple

thanks for sharing your ideas
Best Answer chosen by frog
Swati GSwati G
Hi,

You can use functions on template as shown below
<messaging:attachment filename="{!Year(TODAY())}-{!MONTH(TODAY())}-{!Day(TODAY())}">Your file data</messaging:attachment>


All Answers

Swati GSwati G
Hi,

You can use functions on template as shown below
<messaging:attachment filename="{!Year(TODAY())}-{!MONTH(TODAY())}-{!Day(TODAY())}">Your file data</messaging:attachment>


This was selected as the best answer
frogfrog
Thank you Short and sleek  :-)  I got a mental block yesterday