【发布时间】:2017-01-25 18:36:30
【问题描述】:
一方面
我在集合中有一个字段will,用户可以在其中保存 html 文本(通过 WYSIWYG 编辑器):它工作正常,用户可以编写/保存一些像这样的字符串 it's<strong>bold</strong> and sometimes <i>italic</i>. 没什么疯狂的..
二手
当用户通过电子邮件发送此字段will(作为emailData 的一部分)并在html 模板中使用meteorhacks:ssr 呈现时,该字段将显示为it's<strong>bold</strong> and sometimes <i>italic</i>.,并带有HTML 标记作为普通文本。
那么,任何人都知道在 html 电子邮件正文中呈现的技巧:“它是 bold,有时是 italic。”?谢谢。
我的代码很复杂,很多const和函数继承,但是除了html渲染之外,它工作正常,最终结构如下:
SSR.compileTemplate('htmlEmail', Assets.getText('replycontact.html'));
var emailData = {
message: `${message}`,
will: `${will}`,
origincontactdate: `${origincontactdate}`,
contactname: `${contactname}`,
};
//send the mail
Email.send({
to: to,
from: from,
subject: subject,
html: SSR.render('htmlEmail', emailData),
});
【问题讨论】:
标签: meteor