# 在哪里编辑已关注类别的电子邮件模板并将内容精简至100字？

**URL:** <https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628>\
**Category:** Support\
**Created:** [2019年八月13日 04:39 UTC](https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628 "2019-08-13T04:39:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phuong\_SuSu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/phuong_susu/32/148042_2.png) [@Phuong\_SuSu](https://meta.discourse.org/u/Phuong_SuSu)\
**Post date:** [2019年八月13日 04:39 UTC](https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628/1 "2019-08-13T04:39:49Z")

</div>

你好，

当我的会员选择关注某个分类后，如果有新话题发布，他们将收到一封邮件通知。

但目前的邮件内容是：  
主题：话题标题  
内容：整个话题的全文。

我想将此邮件的模板修改为：  
主题：“新话题已发布……”  
内容：仅显示话题摘要，约 100 字或第一段内容。

我该如何操作？我在管理设置区域找不到该邮件模板。

---

<div class="post-metadata">

**Author:** ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)\
**Post date:** [2019年八月13日 04:40 UTC](https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628/2 "2019-08-13T04:40:46Z")

</div>

该模板名为 `User Posted`

---

<div class="post-metadata">

**Author:** ![Phuong\_SuSu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/phuong_susu/32/148042_2.png) [@Phuong\_SuSu](https://meta.discourse.org/u/Phuong_SuSu)\
**Post date:** [2019年八月13日 05:03 UTC](https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628/3 "2019-08-13T05:03:51Z")

</div>

哦，我明白了。  
但是如何将内容限制为摘要？或者将其缩减到大约 100 字？

---

<div class="post-metadata">

**Author:** ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)\
**Post date:** [2019年八月13日 05:07 UTC](https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628/4 "2019-08-13T05:07:25Z")

</div>

我不相信目前这是可行的。

---

<div class="post-metadata">

**Author:** ![Phuong\_SuSu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/phuong_susu/32/148042_2.png) [@Phuong\_SuSu](https://meta.discourse.org/u/Phuong_SuSu)\
**Post date:** [2019年八月13日 07:31 UTC](https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628/5 "2019-08-13T07:31:20Z")

</div>

太遗憾了。通常人们不会阅读长邮件，所以我希望邮件内容是这样的：

主题：您感兴趣的分类下的新话题  
内容：  
– 标题  
– 内容摘录…  
阅读完整话题的链接…

---

<div class="post-metadata">

**Author:** ![sfoster](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sfoster](https://meta.discourse.org/u/sfoster)\
**Post date:** [2019年八月13日 11:22 UTC](https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628/6 "2019-08-13T11:22:16Z")

</div>

目前您还无法这样做，因为邮件是由核心代码使用在核心中定义的变量生成的。您需要一个插件来覆盖这些变量在邮件模板中的输出。我希望 Discourse 能开发出类似 WordPress 过滤器（Filters）的功能，这样即使是编程新手也能轻松覆盖某些变量（如这些邮件变量）并进行自定义，而无需每次需要自定义某些输出时都编写复杂的插件。据我所知，Discourse 已经通过插件出口（plugin-outlets）实现了类似 WordPress 动作（Actions）的功能，但尚未实现类似 WordPress 过滤器的功能。

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2019年八月13日 22:43 UTC](https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628/7 "2019-08-13T22:43:11Z")

</div>

Neil 刚才不是添加了一个可选设置，用于限制邮件中的帖子内容吗，Hawk？

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2023年二月25日 22:20 UTC](https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628/8 "2023-02-25T22:20:23Z")

</div>



---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年二月26日 08:40 UTC](https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628/9 "2023-02-26T08:40:39Z")

</div>

关于此问题有一个小更新……

> [@JammyDodger](#):
>
> 有一个 `post excerpts in emails` 管理员设置应该对此有帮助：
> 
> ![post excerpts in emails](https://global.discourse-cdn.com/meta/original/4X/5/2/1/521f159b78d4e9b5792607a566c23b92ccab0a04.png)
> 
> 您还可以使用 `post excerpt maxlength` 设置调整摘要长度：
> 
> ![post excerpt maxlength](https://global.discourse-cdn.com/meta/original/4X/1/7/4/174cfc951fd456402c4bd5d533725c154444625e.png)

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年二月26日 08:40 UTC](https://meta.discourse.org/t/where-to-edit-email-template-of-watched-category-and-trim-the-content-to-100-words/125628/10 "2023-02-26T08:40:47Z")

</div>


