我有发送http
POST
请求与以下原料HTML
作为主体的角前端应用上原始HTML输出:发送原始HTML电子邮件hoganjs模板通过的NodeJS给电子邮件客户端
<h1>Hello World</h1><ol><li>Yo</li><li>Bro</li></ol>
我nodejs
后端正在使用sendgrid
发送它,我也使用HoganJs
进行模板化。
但我收到我的电子邮件。
UPDATE
nodejs-sendgrid
sendgrid.send({
to: req.body.mail.email || "",
replyto: "[email protected]",
from: "[email protected]",
subject: req.body.mail.subj,
html: template.render(req.body.mail),
}, function(err, json) {
// do something
});
你能显示你的Node.js代码。具体来说就是发送函数和调用。就像Sendgrid Node.js助手库,如果你使用它 – Iceman
嗯,我只是发送原始字符串'req.body.mail.body'到'template.render(req.body.mail);'@Iceman – CENT1PEDE
帮手有一个setHtml。它打破了正确的标题! – Iceman