通过nodejs发送原始的HTML到电子邮件hoganjs模板在电子邮件客户端提供原始的HTML输出
我有一个angular度的前端应用程序发送一个http
POST
请求与下面的原始HTML
作为正文:
<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: "someemail@gmail.com", from: "someemail@gmail.com", subject: req.body.mail.subj, html: template.render(req.body.mail), }, function(err, json) { // do something });
sendgrid.send({ to: req.body.mail.email || "", replyto: "someemail@gmail.com", from: "someemail@gmail.com", subject: req.body.mail.subj, html: "<b>Hello World</b>", }, function(err, json) { // do something });