【发布时间】:2019-02-19 17:10:25
【问题描述】:
我正在使用 SendGrid 门户来管理我的电子邮件模板,使用把手替换作为此链接中的参考 https://sendgrid.com/docs/ui/sending-email/using-handlebars/#substitution
我想知道是否可以在 SendGrid 交易模板门户中转换和/或格式化日期。
这是我在 SendGrid 门户中的 HTML 模板:
<p>This report was generated on {{GenerationTimeUtc}}</p>
这是发送到 SendGrid 的动态数据:
{
"GenerationTimeUtc":"2018-09-14T21:16:30.1467851Z"
}
我想以更易读的方式显示它,例如 “此报告于 5 月 4 日生成” 而不是显示 “此报告于 2018-09-14T21:16 生成:30.1467851Z"
我正在使用 SendGrid V3
提前致谢。
【问题讨论】:
-
不能只发送 json 格式的日期吗?
-
是的,但这意味着每次用户需要更改日期格式时,我都需要更改我的代码。如果我只能更改模板会更容易