# 在 wysiwyg 编辑器中查看电子邮件模板会导致错误

**URL:** <https://meta.discourse.org/t/viewing-email-templates-in-wysiwyg-composer-causes-an-error/380984>\
**Category:** Bug\
**Tags:** composer, email-templates\
**Created:** [2025年八月29日 22:56 UTC](https://meta.discourse.org/t/viewing-email-templates-in-wysiwyg-composer-causes-an-error/380984 "2025-08-29T22:56:22Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)\
**Post date:** [2025年九月1日 15:07 UTC](https://meta.discourse.org/t/viewing-email-templates-in-wysiwyg-composer-causes-an-error/380984/9 "2025-09-01T15:07:20Z")

</div>

我将使我们能够在应用程序中为特定的 DEditor 组件强制设置某种模式。

另外……这里还有另一个错误。我认为是因为 `text_body_template` 在这里有 `one` 和 `other`，而我们的 UI 没有考虑到这一点，这就是为什么我们看到 `[object Object]` 作为错误的原因：

> <https://github.com/discourse/discourse/blob/13c3cfa5dc62ed6c9975a0258ae77d2d185e1878/config/locales/server.en.yml#L3389-L3391>

这在 Markdown 编辑器中也会发生，所以我们在这里的问题更严重。我们已经处理了主题（Subject）的情况：

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/a/8/2a83cbb20032418fc11f3184d6d56d43d853d9a4.png)

> <https://github.com/discourse/discourse/blob/13c3cfa5dc62ed6c9975a0258ae77d2d185e1878/config/locales/server.en.yml#L4059-L4063>

但没有处理正文模板（body template）的情况。这种情况已经像这样损坏了至少 6 年 [FIX: Don't refer to pending review items as flags · discourse/discourse@76669bb · GitHub](https://github.com/discourse/discourse/commit/76669bb5a6dfa8c3425c1988ae7f240f23fd28cf) …… 我猜没有人尝试编辑过这个模板。

我将在这里实现强制编辑器模式，但也会对模板中的 one+other 进行一些修复，使其与主题（Subject）的处理方式相同。

---

_[View the full topic](https://meta.discourse.org/t/viewing-email-templates-in-wysiwyg-composer-causes-an-error/380984)._
