# “在摘要电子邮件中隐藏这些标签”设置在预览摘要电子邮件中不起作用？

**URL:** <https://meta.discourse.org/t/suppress-these-tags-from-summary-emails-settings-is-not-working-in-preview-digest-email/279196>\
**Category:** Bug\
**Tags:** activity-summary\
**Created:** [2023年九月15日 23:34 UTC](https://meta.discourse.org/t/suppress-these-tags-from-summary-emails-settings-is-not-working-in-preview-digest-email/279196 "2023-09-15T23:34:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![th21](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/th21/32/211915_2.png) [@th21](https://meta.discourse.org/u/th21)\
**Post date:** [2023年九月15日 23:34 UTC](https://meta.discourse.org/t/suppress-these-tags-from-summary-emails-settings-is-not-working-in-preview-digest-email/279196/1 "2023-09-15T23:34:03Z")

</div>

我在新设置中排除了一些标签，并尝试预览摘要电子邮件，预览中包含一些重复的主题，并且包含带有这些标签的主题。

---

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [2023年九月16日 01:21 UTC](https://meta.discourse.org/t/suppress-these-tags-from-summary-emails-settings-is-not-working-in-preview-digest-email/279196/2 "2023-09-16T01:21:32Z")

</div>

在我的本地开发站点上对此进行测试，似乎存在一个错误。代码期望 `digest_suppress_tags` 设置是一个管道分隔的标签 ID 列表，但实际上它是一个标签名称列表：

> <https://github.com/discourse/discourse/blob/main/app/models/topic.rb#L592>

这是我的站点上设置的外观：

```plaintext
SiteSetting.digest_suppress_tags
=> "foo|bar"

```

排除摘要中标签的代码期望该设置的值为 `"1|2"`（标签 ID）。

请注意，`digest_suppress_categories` 设置可以正常工作。设置 category-selector 保存的是类别 ID，而不是类别名称。

---

<div class="post-metadata">

**Author:** ![Osama](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osama/32/98013_2.png) [@Osama](https://meta.discourse.org/u/Osama)\
**Post date:** [2023年九月19日 08:20 UTC](https://meta.discourse.org/t/suppress-these-tags-from-summary-emails-settings-is-not-working-in-preview-digest-email/279196/5 "2023-09-19T08:20:19Z")

</div>

这已在以下位置修复：

> <https://github.com/discourse/discourse/commit/83621ccbe797223b48b624b00ef04f24672e1f03>
>
> Meta topic: https://meta.discourse.org/t/suppress-these-tags-from-summary-emails…-settings-is-not-working-in-preview-digest-email/279196?u=osama
> 
> Follow-up to https://github.com/discourse/discourse/commit/477a5dd371e9605a0c0058d0805c767c77fa7c93
> 
> The \`digest\_suppress\_tags\` setting is designed to be a list of pipe-delimited tag names, but the tag-based topic suppression logic assumes (incorrectly) that the setting contains pipe-delimited tag IDs. This mismatch in expectations led to the setting not working as expected.
> 
> This PR adds a step that converts the list of tag names in the setting to their corresponding IDs, which is then used to suppress topics tagged with those specific tags.

感谢 @th21 的报告以及 @simon 的精彩分析/调试！

---

<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年九月27日 09:50 UTC](https://meta.discourse.org/t/suppress-these-tags-from-summary-emails-settings-is-not-working-in-preview-digest-email/279196/6 "2023-09-27T09:50:28Z")

</div>


