# 禁用版主状态邮件通知

**URL:** <https://meta.discourse.org/t/disable-email-notification-of-moderator-status/155846>\
**Category:** Feature\
**Created:** [2020年六月24日 18:54 UTC](https://meta.discourse.org/t/disable-email-notification-of-moderator-status/155846 "2020-06-24T18:54:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2020年六月24日 18:54 UTC](https://meta.discourse.org/t/disable-email-notification-of-moderator-status/155846/1 "2020-06-24T18:54:47Z")

</div>

我昨天运行了一次导入操作，结果收到了一封紧急邮件，称所有版主都收到了一封名为“你是版主！！！！！”的邮件通知。实际上，大多数版主本不该这么快得知即将进行的迁移。

过去几周我多次运行了相同的导入脚本（更不用说过去三年里运行过的众多导入操作），但从未出现过这种情况。所以我猜，过去一周左右可能发生了某些变化，导致新增了这则通知？我快速查看了近期的提交记录，但并未找到相关改动。

我修改了脚本，在用户创建记录中加入了 `active: false`，但这很可能也会给其他人带来麻烦。

虽然已设置 `disable_emails=non-staff`，但版主属于 staff 范畴，所以……我想我只能禁用所有邮件通知了。

我不太清楚具体的功能需求是什么……是在 `base.rb` 中禁用这些通知吗？不过，

> <https://github.com/discourse/discourse/blob/main/script/import_scripts/base.rb#L81>

哦，但随后在 `reset_site_settings` 中又会被取消设置。或许应该添加一个“当用户被提升为版主或管理员时不发送通知”的设置？

---

<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:** [2020年六月25日 03:09 UTC](https://meta.discourse.org/t/disable-email-notification-of-moderator-status/155846/2 "2020-06-25T03:09:53Z")

</div>

我认为最好使用现有的“禁用所有邮件”设置。

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2020年六月25日 04:46 UTC](https://meta.discourse.org/t/disable-email-notification-of-moderator-status/155846/3 "2020-06-25T04:46:32Z")

</div>

这听起来确实是使用 Mailhog 的完美场景。

它可以让您（以及您的客户）清楚地看到迁移将生成哪些邮件，并在适当的时候将其发布到外部世界。这已成为我标准工具包的一部分。
