Skip to content

[3.0] Only digests the boards and topics a member asked to be emailed about - #9614

Open
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/digest-email-optin
Open

[3.0] Only digests the boards and topics a member asked to be emailed about#9614
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/digest-email-optin

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Watching a board or a topic records two things: a row in log_notify, and a preference whose bits say whether the member wants an alert, an email, or both. SendDigests read the rows and never the preference, so a member who asked for alerts alone was emailed a summary of everything they were watching.

That is not an obscure combination — it is the default. On a fresh profile the "Notify me of replies" and "Notify me of new topics" email boxes are unticked, so watching a board through the normal link writes board_notify_<id> = 1, alert only. CreatePost_Notify honours that and sends no email; the digest ignored it and did.

The watcher lists are now filtered by the same preference, resolved the way CreatePost_Notify resolves it: the per board or per topic setting where the member made one, otherwise their general board_notify / topic_notify. The preference fetch moves up to where the lists are built, since that is now where it is needed.

Verified on the Docker stack. UserA watching a board with the email box ticked and UserB watching the same board with it unticked: before, both mails listed the new topic and the reply; after, only UserA's does.

Note that UserB still receives a mail, now with nothing in it. That is a separate defect — the digest is assembled and sent whether or not any section found anything — and is fixed in #9615. The two touch the same file.

Not covered by a test. SendDigests::execute() opens with a query and needs a database throughout, so it is out of scope for the unit suite.

Issues References (Fixes|Related|Closes)

  1. Related: [3.0 & 2.1]: Empty daily digest emails getting sent; Folks who have not opted-in to email are receiving digests; Emails in wrong language #9609 — "emails are getting sent to folks who have not opted in".
  2. Related: [3.0] Stops sending a digest to members who have nothing to be told about #9615, the empty digest that this change leaves behind.

🤖 Generated with Claude Code

Watching a board or a topic records two things: a row in log_notify, and a
preference whose bits say whether the member wants an alert, an email, or
both. The digest read the rows and never the preference, so a member who
asked for alerts alone was emailed a summary of everything they were
watching - the notification setting they had chosen said email was not
wanted, and the immediate notifications honoured it while the digest did not.

The watcher lists are now filtered by the same preference, resolved the same
way SMF\Tasks\CreatePost_Notify resolves it: the per board or per topic
setting where the member made one, otherwise their general setting for boards
or topics.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant