Skip to content

Add a notification setting for likes, reposts and quotes - #3582

Open
pfefferle wants to merge 3 commits into
trunkfrom
add/reaction-email-setting
Open

Add a notification setting for likes, reposts and quotes#3582
pfefferle wants to merge 3 commits into
trunkfrom
add/reaction-email-setting

Conversation

@pfefferle

Copy link
Copy Markdown
Member

Fixes #3578

Proposed changes:

  • Likes, reposts and quotes are stored as comments, so they trigger WordPress's normal "new comment" email to the post author. That email is separate from the ActivityPub notification settings, so until now there was no way to turn it off without also silencing real comments and replies.
  • This adds a "Likes, Reposts and Quotes" toggle to the notification settings. It defaults to on, so nothing changes for existing users until they turn it off. When it is off, the author no longer gets an email for reaction comments, while real replies still notify as before.

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Go to Users > Profile and find the ActivityPub notification settings. Confirm the new "Likes, Reposts and Quotes" checkbox is there and checked by default.
  • With it checked, receive (or insert) a like or repost comment on one of your posts. You get the usual "new comment" email.
  • Uncheck the box and save. A new like, repost or quote no longer emails you.
  • A real reply still emails you, whether the box is checked or not.

Changelog entry

The changelog entry is already included in the branch (.github/changelog/add-reaction-email-setting), so the auto-create box below is left unchecked.

Changelog Entry Details

Significance

  • Minor

Type

  • Added - for new features

Message

Add a notification setting to turn off emails about likes and reposts without silencing real comments and replies.

@pfefferle pfefferle self-assigned this Jul 27, 2026
@pfefferle
pfefferle requested a review from a team July 27, 2026 13:45
@pfefferle
pfefferle marked this pull request as ready for review July 27, 2026 13:53
Copilot AI review requested due to automatic review settings July 27, 2026 13:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a per-user notification toggle to suppress WordPress “new comment” emails for ActivityPub reaction comments (likes/reposts/quotes) while leaving normal replies unaffected, addressing #3578.

Changes:

  • Introduces a new user option (activitypub_mailer_new_reaction) with a default “on” behavior.
  • Adds a new checkbox in the user’s ActivityPub “Email Notifications” settings and persists it on save.
  • Updates comment-notification suppression logic and adds PHPUnit coverage for the new behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
includes/class-mailer.php Applies the new per-user setting when deciding whether to send comment-notification emails.
includes/class-activitypub.php Registers the new user meta and default behavior via get_user_option_* filter.
includes/wp-admin/class-user-settings-fields.php Adds the “Likes, Reposts and Quotes” checkbox to the profile notification settings UI.
includes/wp-admin/class-admin.php Persists the new user option on settings save.
tests/phpunit/tests/includes/class-test-mailer.php Adds a unit test for the new reaction notification behavior.
.github/changelog/add-reaction-email-setting Documents the new notification setting in the changelog.

Comment thread includes/class-mailer.php Outdated
Comment thread tests/phpunit/tests/includes/class-test-mailer.php Outdated
Comment thread .github/changelog/add-reaction-email-setting Outdated
@pfefferle

Copy link
Copy Markdown
Member Author

Thanks, all three are addressed in 1b06ab0:

  • The reaction opt-out is now its own filter on notify_post_author only, so it no longer affects the moderator notification.
  • It matches the plugin's own reaction comment types via Comment::get_comment_type_slugs() instead of "not a plain comment", so pingbacks and trackbacks keep notifying, and any reaction type we register later is covered automatically.
  • Added a repost case to the test, plus a check that the moderator notification is not gated by the author's preference.
  • Updated the changelog to mention quotes.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

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.

Can't disable e-mail notifications

2 participants