# 摘要邮件未发送给所有用户——需要帮助调试

**URL:** https://meta.discourse.org/t/digest-emails-not-sending-to-all-users-need-help-debugging/357419
**Category:** Support
**Tags:** email
**Created:** [2025年三月15日 22:52 UTC](https://meta.discourse.org/t/digest-emails-not-sending-to-all-users-need-help-debugging/357419 "2025-03-15T22:52:07Z")
**Posts on this page:** 6
**Page:** 2

<div class="post-metadata">

### Author: ![Jacob\_Peebles](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jacob_peebles/32/168161_2.png) [@Jacob\_Peebles](https://meta.discourse.org/u/Jacob_Peebles)
#### Post date: [2025年三月20日 11:19 UTC](https://meta.discourse.org/t/digest-emails-not-sending-to-all-users-need-help-debugging/357419/25 "2025-03-20T11:19:41Z")

</div>

@Canapin 我们也没有看到任何文档指出此设置与电子邮件相关……不过，很高兴知道它在哪里 @Heliosurge 感谢您指出这一点。

又一天过去了，没有任何摘要被创建。我们在过去 24 小时内发布了一个新主题来触发一些操作，但什么都没有……

大家还有其他想法吗？我们是否遗漏了某个日志？是否有我们能看到并纠正的失败之处？

---

<div class="post-metadata">

### Author: ![Jacob\_Peebles](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jacob_peebles/32/168161_2.png) [@Jacob\_Peebles](https://meta.discourse.org/u/Jacob_Peebles)
#### Post date: [2025年三月20日 11:29 UTC](https://meta.discourse.org/t/digest-emails-not-sending-to-all-users-need-help-debugging/357419/26 "2025-03-20T11:29:13Z")

</div>

考虑到这一点，我们假设问题与系统中的用户数量有关。奇怪的是，自迁移到 Discourse 以来，这个数字并没有增加超过 10。

我们大约有：

- 100 万活跃用户
- 240 万已停用用户

也许系统在执行此查找时会出现某种奇怪的超时？如果失败，我们会在哪里看到输出？

同样，这似乎很奇怪，因为消化邮件（digest）发送正常，至少在一两周前是这样，尽管数量有限。

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [2025年三月20日 12:24 UTC](https://meta.discourse.org/t/digest-emails-not-sending-to-all-users-need-help-debugging/357419/27 "2025-03-20T12:24:04Z")

</div>

> [@Jacob\_Peebles](#):
>
> 这种逻辑是否也与 Discourse 考虑的发送摘要的日期有关？

也许，或者其他原因导致摘要为空，因此未发送给用户。

我不知道摘要是如何生成的。我不知道它是否考虑了用户忽略的类别，或者类似的东西。

我猜如果通过 rails 控制台手动发送摘要，您的用户将收不到摘要？

```scss
user = User.find_by(username: 'user-name')
Jobs.enqueue(:user_email, type: :digest, user_id: user.id)

```

运行此命令几秒钟后，您应该会看到 Sidekiq 已处理的作业增加了 1，但如果您的论坛很大，任何时候都可能有大量 Sidekiq 作业，因此可能很难看到它是否增加了。  
您可以使用实时轮询按钮实时查看：

 ![此图像显示了一个 Sidelkik 仪表板，显示系统状态和进程，其中包含 1,101 个已处理的任务、5 个正在运行的线程、0 个忙碌的任务以及主机上的 423 MB RSS 使用量。（由 AI 题注）](https://global.discourse-cdn.com/meta/original/4X/f/a/e/fae71dd5ed2d4bdaba0bc00e33cb5da94a2b874b.png)

根据我的测试，如果我运行 rails 脚本向用户发送摘要，但摘要为空：

- 因为用户之前已收到
- 或在其个人资料中禁用了电子邮件摘要
- 等等…

然后 Sidekiq 已处理的作业数量会增加一，但不会发送电子邮件，并且 `/admin/email/sent` 中不会有新条目。

也许您可以记录已处理的 Sidekiq 作业，看看其中是否有任何线索。我搜索了一下，但不确定它是否默认记录了已处理的作业。

我认为有一个合乎逻辑、合理的解释，说明为什么用户收不到摘要。作业可能已处理，但摘要可能为空，这可以解释为什么没有它的痕迹。  
我会再次仔细检查所有相关用户的设置、他们的通知级别、他们跟踪的类别等等。

---

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [2025年三月20日 12:50 UTC](https://meta.discourse.org/t/digest-emails-not-sending-to-all-users-need-help-debugging/357419/28 "2025-03-20T12:50:22Z")

</div>

在摘要发送机制中添加调试输出会相当容易。  
你是否有一个预发布站点，可以在不影响你的生产环境的情况下进行测试？

在那里，可以测试例如查询是否发生超时。基于直觉，我会预计超时会在日志中被看到。

此外，可以增强构建目标人群的查询，加入统计输出。

所有这些在沙箱环境中都不难，但在生产环境中可能会有一定的风险。

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2025年十一月3日 20:16 UTC](https://meta.discourse.org/t/digest-emails-not-sending-to-all-users-need-help-debugging/357419/29 "2025-11-03T20:16:24Z")

</div>

继续：

> [@Digest Emails Not Sending to All Users – Need Help Debugging](https://meta.discourse.org/t/digest-emails-not-sending-to-all-users-need-help-debugging/357419?u=tobiaseigen):
>
> Hi everyone, A large Discourse forum is experiencing an issue where digest emails (activity summary emails) are not being delivered to all eligible users as expected. Issue Details: I understand that digest emails are sent only to inactive users, but based on our settings, there should still be many recipients. Some users who were last seen within 180 days are not receiving digest emails. There are no clear errors in the Admin \> Emails \> Skipped logs, but the emails are not being delivered. S…

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2025年十一月3日 20:16 UTC](https://meta.discourse.org/t/digest-emails-not-sending-to-all-users-need-help-debugging/357419/30 "2025-11-03T20:16:55Z")

</div>



[上一頁](https://meta.discourse.org/t/digest-emails-not-sending-to-all-users-need-help-debugging/357419.md?page=1)
