sendgrid / email-templates

A repository of common email templates to use and modify to your heart's content.
https://sendgrid.com
MIT License
818 stars 987 forks source link

Can not use formatDate helper without time part #98

Open rudrikandharia opened 2 years ago

rudrikandharia commented 2 years ago

Expected Behaviour

Template should be rendered, and test email should be received.

Actual Behaviour

Test email is not received. It works on preview, also on sending test email it says, test email sent successfully, but test email never received

Steps to reproduce it

Email template <p>{{formatDate recommendation.project.start_date "DD MMM YYYY"}}</p>

Test data { "recommendation": { "project": { /* ---------------- */ "start_date": "2022-07-04" } } }

We have to pass whole date time, otherwise its not working with formatDate, e.g."start_date": "2022-07-04T00:00:00Z" If this is expected behaviour, then preview should not display it or at least test mail sending should not display success message. Or it would be great if date without time is allowed on formatDate, assuming time is 00:00:00Z.