2016-07-16 3 views
1

이메일 클라이언트에 원시 HTML 출력을 제공합니다내가 몸으로 다음과 같은 원시 <code>HTML</code>와 <code>http</code><code>POST</code> 요청을 보내는 각 프런트 엔드 응용 프로그램이

<h1>Hello World</h1><ol><li>Yo</li><li>Bro</li></ol>

nodejs 백엔드는 sendgrid을 사용하여 보내고 있습니다. 나는 템플릿으로도 HoganJs을 사용하고 있습니다.

그러나 나는 내 이메일에서 이것을 받았습니다.

enter image description here

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 
}); 
+0

당신은 당신의 Node.js를 코드를 보여줄 수 없습니다. 특히 send 함수와 호출. 그것을 사용하는 경우 Sendgrid Node.js 도우미 라이브러리처럼 – Iceman

+0

그럼 원시 문자열'req.body.mail.body'을'template.render (req.body.mail);로 보내고있었습니다 @Iceman – CENT1PEDE

+0

도우미 setHtml을가집니다. 그것은 적절한 헤더를 설정 shud! – Iceman

답변

1
sendgrid.send({ 
    to:  req.body.mail.email || "", 
    replyto: "[email protected]", 
    from:  "[email protected]", 
    subject: req.body.mail.subj, 
    html:  "<b>Hello World</b>", 
}, function(err, json) { 
    // do something 
}); 
+0

하지만 이미'html : template.render()'를 사용하고 있습니다. – CENT1PEDE

+0

@ TheGreenFoxx 님이 지금 편집을 보았습니다. – Iceman

+0

이상한가? 다른 방법을 생각해 볼 수 있습니까? – CENT1PEDE

관련 문제