-
Notifications
You must be signed in to change notification settings - Fork 85
Add email notifications for new quote events #2303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implements email notifications when a user's post is quoted, including user and blog-level settings, email template, and tests. Updates admin and settings UI to allow enabling/disabling quote notifications. Adds comprehensive PHPUnit tests for the new notification logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements email notifications when a user's post is quoted on the Fediverse. The feature adds comprehensive notification settings for both individual users and blog-level configurations, along with a dedicated email template and extensive test coverage.
- Adds email notification functionality for quote events with user and blog-level settings
- Creates a new email template specifically for quote notifications
- Implements comprehensive PHPUnit test coverage for the notification logic
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
includes/class-mailer.php | Adds new quote() method for handling quote notification emails with proper user preference checks |
templates/emails/new-quote.php | New email template for quote notifications with embedded content display |
includes/wp-admin/class-user-settings-fields.php | Adds quote notification checkbox to user settings interface |
includes/wp-admin/class-blog-settings-fields.php | Adds quote notification checkbox to blog settings interface |
includes/wp-admin/class-settings.php | Registers new blog-level quote notification setting |
includes/wp-admin/class-admin.php | Includes quote notification setting in user options processing |
includes/class-activitypub.php | Registers quote notification user meta field with proper defaults |
tests/phpunit/tests/includes/class-test-mailer.php | Comprehensive test coverage for quote notification functionality |
tests/phpunit/tests/includes/handler/class-test-quote-request.php | Adds preferredUsername field to test actor data |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Replaces a line comment with a PHPDoc-style comment for the 'mention' action hook to improve code documentation consistency.
Co-authored-by: Konstantin Obenland <obenland@gmx.de>
Updated block comments for clarity and consistency in the mailer class. Simplified the quote URL assignment by using null coalescing, improving code readability.
Co-authored-by: Konstantin Obenland <obenland@gmx.de>
Co-authored-by: Konstantin Obenland <obenland@gmx.de>
Simplified the wording in the notification email when a post is quoted on the Fediverse. The message is now more direct and concise.
Adds a check to return early if $quoted_url is not set, avoiding further processing and potential errors when quoteUrl is missing in the activity object.
10c9c14
to
0b8fd5e
Compare
A couple more thoughts on this:
|
- Fetch remote quote object when only URL is available - Support both 'quote' (FEP-044f) and 'quoteUrl' properties - Simplify email template to use pre-prepared variables - Add direct link to quoted post for better user experience - Improve plaintext alternative message formatting
- Use activitypub_pre_http_get_remote_object filter for mocking - Template expects quote_object to always be an array from mailer - All 1116 tests pass successfully
The two remaining items of uncertainty for me:
|
@obenland Mastodon does not send an ![]() |
We could add Quotes as Comments though. This way we could re-use (update) the comment Mails. |
No, not even live! |
@obenland have you clicked repost and quote? |
(because you can do both actions on the same item) |
Not that I know of. It gives me two options and I clicked quote. |
Yeah not sure I have an opinion on that, tbh, I'd just go with your preference on this. |
@obenland can you try to reproduce if you receive two mails or not? I tried it several times and can not reproduce it. |
Interesting, I can't reproduce it anymore, no. Checking that off the list. |
What should we do with that? |
Implements email notifications when a user's post is quoted, including user and blog-level settings, email template, and tests. Updates admin and settings UI to allow enabling/disabling quote notifications. Adds comprehensive PHPUnit tests for the new notification logic.
Proposed changes:
Other information:
Testing instructions:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Added email notifications for quoted posts, with user and blog-level settings and a new customizable email template.