1

I have a confirmation email. In the confirmation email i print the Date of the event (Date field) in the e-mail body by [entity-fetched:field_event_date].

This is working fine but the Date is printed like 2016-04-13 16:30:00 to 2016-04-13 20:00:00

How do i print a custom Date format like i.e. 09-Jan-2016 in my email body?

2

[Updated] You will need to have the Token and Entity Token modules enabled. Then you'll print custom date format with the following token

[entity-fetched:field-event-date:value:custom:d-M-Y] 

the token should produce the date in the format

09-Jan-2016

refer to PHP Manual for custom date formats.

3
  • I have both above modules enabled. But when i put [entity-fetched:field_event_date:value:custom:d-M-Y . Its blank. It doesn't show anything. I also tried [entity-fetched:field_event_date:custom:d-M-Y What could be the problem? – meez Jan 10 '16 at 13:33
  • try replacing underscores with hyphens – oksana-c Jan 10 '16 at 14:06
  • You're welcome! I updated the answer - please mark it as correct. – oksana-c Jan 10 '16 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.