# 批量编辑 Tags 也不应触发成千上万的电子邮件通知！

**URL:** <https://meta.discourse.org/t/bulk-editing-of-tags-should-not-trigger-thousands-of-email-notifications-either/378670>\
**Category:** Feature\
**Tags:** notifications, tags, bulk-actions\
**Created:** [2025年八月14日 23:39 UTC](https://meta.discourse.org/t/bulk-editing-of-tags-should-not-trigger-thousands-of-email-notifications-either/378670 "2025-08-14T23:39:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)\
**Post date:** [2025年八月14日 23:39 UTC](https://meta.discourse.org/t/bulk-editing-of-tags-should-not-trigger-thousands-of-email-notifications-either/378670/1 "2025-08-14T23:39:09Z")

</div>

由于[这项新功能](https://meta.discourse.org/t/bulk-editing-topic-categories-should-not-trigger-thousands-of-email-notifications/265269)，我们现在可以轻松地静默更改主题类别（无需麻烦地进行网站设置），这真是太棒了：

> <https://github.com/discourse/discourse/commit/7a099ebb6a4c4f177cd416414914d8f902558e90>
>
> We want to add an option for admins to carry out the operation silently
> when the…y are updating the category for the selected topics. When the
> “Perform this action silently” checkbox has been checked, the
> \`:notify\_category\_change sidekiq\` job should not be enqueued.

但是，同样的问题也存在于标签编辑中。有没有可能将此功能扩展到标签？

---

<div class="post-metadata">

**Author:** ![Zanbabe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zanbabe/32/300386_2.png) [@Zanbabe](https://meta.discourse.org/u/Zanbabe)\
**Post date:** [2025年十二月17日 15:04 UTC](https://meta.discourse.org/t/bulk-editing-of-tags-should-not-trigger-thousands-of-email-notifications-either/378670/2 "2025-12-17T15:04:11Z")

</div>

这绝对是必需的。

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2026年二月16日 17:02 UTC](https://meta.discourse.org/t/bulk-editing-of-tags-should-not-trigger-thousands-of-email-notifications-either/378670/3 "2026-02-16T17:02:57Z")

</div>

在处理这些拉取请求（PR）时，我注意到批量编辑标签永远不会生成任何通知，因此可以关闭此项。

> <https://github.com/discourse/discourse/pull/37832>
>
> When performing a bulk category move with the "Notify users of this change" opti…on unchecked, topic authors were still receiving "edited" notifications. This happened because the silent flag was not propagated to the PostRevision \`after\_create\` callback.
> 
> The original implementation (7a099ebb) correctly suppressed the \`notify\_category\_change\` job (PostAlerter path) but missed the second notification path: \`PostActionNotifier.after\_create\_post\_revision\`, which fires via the PostRevision \`after\_create\` callback when \`create\_revision\_on\_bulk\_topic\_moves\` is enabled.
> 
> This fix adds a transient \`silent\` attr\_accessor to PostRevision, set by PostRevisor before saving, and checked as an early return guard in \`PostActionNotifier.after\_create\_post\_revision\`.
> 
> The specs are also updated to properly enable PostActionNotifier (which is disabled by default in tests) so the revision notification path is actually exercised.
> 
> Ref - t/174237

> <https://github.com/discourse/discourse/pull/37848>
>
> Bulk tag operations (change, append, remove) were directly manipulating tag reco…rds via DiscourseTagging and TopicTag, bypassing PostRevisor entirely. This meant callbacks, plugin hooks, and other side effects tied to the revision pipeline were not triggered.
> 
> This refactors the three bulk tag actions to go through \`first\_post.revise\` instead, using \`silent: true\` to avoid sending notifications and \`skip\_revision: true\` to avoid creating revision records, preserving the existing quiet behavior.
> 
> Also adds eager loading of first\_post and tags to avoid N+1 queries, simplifies tag input handling by normalizing both tag\_ids and tag\_names into a single code path, and refactors \`notification\_is\_disabled?\` in PostActionNotifier for readability.

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2026年二月16日 17:03 UTC](https://meta.discourse.org/t/bulk-editing-of-tags-should-not-trigger-thousands-of-email-notifications-either/378670/4 "2026-02-16T17:03:02Z")

</div>


