如何使用ckeditor发送响应式邮件

how to send responsive email with ckeditor

我正在使用 ckeditor 从网络服务器发送电子邮件。 但是我怎样才能使电子邮件的内容具有响应性呢? 据我所知,我尝试过的所有 "responsive email" 模板都以:

开头
<center>
   <table style="width: 100%">
      <tr>
         <td>
         Some content goes here...
         </td>
      </tr>
    </table>
</center>

我需要像这样使用媒体查询吗?

@media (max-width: 450px) {
   table {
    max-width: 360px;
   }
}

如果是这样:我必须将它们放在 ckeditor 的文本区域中的什么位置才能随电子邮件一起发送?

如果您单击工具栏中的按钮查看源代码,您可以在页面顶部添加一个样式标签。

CKEditor 还允许您添加内联 CSS.

然而,要使这两个都起作用,您需要在 ckeditor 的 config.js 文件中启用 allowedContent。

 config.allowedContent = true;

或者您可以在启动 CKEditor 时启用 allowedContent

<script>
        CKEDITOR.replace( 'text-area-id' );
        CKEDITOR.config.allowedContent = true;
</script>

这是文档:https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html