【问题标题】:How to send email with ckeditor without Html tags如何使用不带 Html 标签的 ckeditor 发送电子邮件
【发布时间】:2019-04-15 15:01:01
【问题描述】:

我在我的项目 symfony 中集成了 ckeditor 用于发送电子邮件。

我已经在表单生成器中添加了这个

->add('message', CKEditorType::class)

CKEditor 它的工作,我看到了工具栏 但是当我发送电子邮件时,我会收到这样的消息

<p>Hello,</p>
<p><strong> This is an example</strong></p>

我的问题是我不接收带有 html 标签的消息,我想像这样接收它

你好 这是一个例子

【问题讨论】:

  • 看起来您将 HTML 文本作为纯文本电子邮件发送。您应该将其作为 HTML 电子邮件发送。这对你有意义吗?
  • @KIKOSoftware 谢谢,我已将消息添加为 html : ->setBody( $message,'text/html' )
  • 告诉我们您发送电子邮件的位置

标签: php symfony ckeditor symfony-forms swiftmailer


【解决方案1】:

您可以使用 twigs 原始过滤器,因此在渲染它的模板中使用:

{{ message|raw }}

这将使您的 CKEditor 标签变得很强大。

您可以在此here 上阅读更多信息。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2020-06-12
  • 1970-01-01
  • 2016-04-04
  • 1970-01-01
  • 1970-01-01
  • 2016-07-16
  • 2020-04-03
  • 2013-05-18
相关资源
最近更新 更多