我正在使用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"
}
}
}
}
}
});
}
非常感谢您的帮助。
最好的祝福
X-SMTPAPI
头部转换为字符串吗? - MasterAM