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>
// . . .