【问题标题】:Jade email template翡翠电子邮件模板
【发布时间】:2016-12-25 18:10:39
【问题描述】:

我正在尝试使用 express-mailer 在我的 NodeJS 应用程序中发送电子邮件,并且我想使用 Jade 撰写响应式电子邮件,但在呈现此电子邮件时遇到问题:我添加到电子邮件模板的样式未应用于其模板.比如下面的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
html
    head
        meta(http-equiv = 'Content-Type', content = 'text/html; charset=UTF-8')
        style.
            body {
                background-color: #dfdfdf;
                width: 320px;
                height: 620px;
            }

            .container {
                width: 90%;
                height: 90%;
                margin: auto;
                display: flex;
                flex-deirection: column;
                background-color: white;
                border-radius: 4px;
            }
    body
        .container Hello

在 gmail 中呈现的电子邮件如下所示:

那么,在撰写此类电子邮件时,我可能会犯哪些错误?我应该如何做才能让某些事情发挥作用?

【问题讨论】:

    标签: javascript node.js email pug


    【解决方案1】:

    许多电子邮件客户端希望样式是内联的并去掉 CSS 标头:

    https://github.com/RGBboy/express-mailer/issues/28

    有一些工具可以将带有模板的 CSS 文件转换为内联 CSS,例如,https://github.com/crocodilejs/node-email-templates

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-09
      • 2012-04-23
      • 2013-05-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多