如何使用Sendgrid引用和创建动态电子邮件



我对这里的文档感到不知所措。

我正在尝试创建一个基本的helloworld电子邮件模板,其中包含一些简单的电子邮件替换,但我无法理解语法。

这里的文档建议使用-igetreplaced-语法,并给出以下示例:

<html>
<head></head>
<body>
<p>Hello -name-,<br>
Thank you for your interest in our products. I have set up an appointment to call you at -time- EST to discuss your needs in more detail. If you would like to reschedule this call, please visit the following link: `<a href="http://example.com/reschedule?id=-customerID-">reschedule</a>`
Regards,
-salesContact-
-contactPhoneNumber-<br>
</p>
</body>
</html>

附带的SMTP API JSON头可能看起来像这样:

{
"to": [
"example@example.com",
"example@example.com"
],
"sub": {
"-name-": [
"John",
"Jane"
],
"-customerID-": [
"1234",
"5678"
],
"-salesContact-": [
"Jared",
"Ben"
],
"-contactPhoneNumber-": [
"555.555.5555",
"777.777.7777"
],
"-time-": [
"3:00pm",
"5:15pm"
]
}
}

我尝试过将这些粘贴到模板代码编辑器中,但不起作用。

有人能给我指一下正确的语法文档吗?

语法为Handlebars。

这样使用:

Hello {{name}} 

带数据:

{
"name": "Bob"
}

最新更新