You need to sign in to do that
Don't have an account?

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