【发布时间】:2017-11-10 07:38:45
【问题描述】:
我正在使用 sendgrid 发送电子邮件。我想将模板作为电子邮件发送给用户。下面的代码只是发送简单的基于文本的电子邮件,而不是定义标题部分并使用模板 ID。
if (Meteor.isServer) {
Email.send({
from: "from@mailinator.com",
to: "abc@mail.com",
subject: "Subject",
text: "Here is some text",
headers: {"X-SMTPAPI": {
"filters" : {
"template" : {
"settings" : {
"enable" : 1,
"Content-Type" : "text/html",
"template_id": "3fca3640-b47a-4f65-8693-1ba705b9e70e"
}
}
}
}
}
});
}
我们将非常感谢您的帮助。
最好的
【问题讨论】:
-
从 sendgrid 文档看来,您所做的一切都是正确的。来自 Meteor 的同上。邮件中是否包含标头?
-
您是否尝试过将
X-SMTPAPI标头字符串化? -
你解决了吗?
标签: meteor sendgrid sendgrid-templates