0
我想要插入HTML文件模板以用于与节点一起发送的电子邮件中。如何在节点中为电子邮件插入HTML文件模板
当我使用下面的代码,我得到这个错误...
(function (exports, require, module, __filename, __dirname) { <!doctype html>
有什么建议?
var template = require('../../views/email-template.js');
var htmlAll = _.template(template)(contactinfo[0]);
var data = {
from: [email protected],
to: email,
subject: 'Your Order Confirmation',
html: htmlAll
电子邮件template.js
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Email</title>
<style media="all" type="text/css">
// . . .
<table>
// . . .
<td><%= firstName %> <%= lastName %>
<br><%= company %>
<br><%= address %>
<br><%= city %>, <%= state.code %> <%= zip %>
<br><%= email %>
<br><%= phone %>
</td>
</tr>
</table>
// . . .