#59250 closed enhancement (fixed)
New Admin Email subject line should be filterable
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.5 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | good-first-bug has-patch has-unit-tests has-test-info commit add-to-field-guide |
| Focuses: | Cc: |
Description
When a user attempts to update the Administration Email Address (Settings->Reading), they receive an email with a link they must click to confirm the change.
The body of the email is filterable (new_admin_email_content), but sadly the subject is not.
I'm proposing adding a new filter, such as new_admin_email_subject, that lets users customize this message.
For reference, I was looking to make it clearer that there is still action needed (to confirm the change), because I've seen LOTS of situations on our networks where these email updates are started - but never confirmed - likely due to the subject line sounding way more like a confirmation than something that requires action.
Attachments (4)
Change History (22)
#1
@
2 years ago
- Component changed from General to Administration
- Keywords needs-patch good-first-bug added
- Version trunk deleted
#3
follow-up:
↓ 11
@
2 years ago
- Keywords has-unit-tests has-testing-info needs-testing added
Testing Instructions
These steps define how to test the feature or enhancement, and indicates the expected behavior or results.
Steps to Test
- Add function to functions.php:
<?PHP function updated_admin_email_subject() { return 'Filtered Admin Subject'; } add_filter('new_admin_email_subject', 'updated_admin_email_subject');
- Login to to wp-admin dashboard
- Go to the Settings > General page
- Change the Administration Email Address
- Click on Save Changes
Expected Results
Lists each expected result or behavior, i.e. what should happen when running the test(s):
- ✅ E-Mail Received with "Filtered Admin Subject" as the subject line
#5
@
2 years ago
In a fresh WordPress 6.3.2 installation I applied the following patch.diff and added the code listed in the Testing Instructions. After changing the admin email address I received an email with the subject "Filtered Admin Subject".
In short: Works as expected ;-)
#6
@
2 years ago
On a local fresh WP installation (6.3.2) I tested patch.diff. I added the the testing Code in functions.php and after I changed the admin Email, I received the updated email Subject 'Filtered Admin Subject'.
Works like a charm :)
@
2 years ago
Updated the patch to include comments on the filter so that the Code Reference documentation is updated properly.
#7
@
2 years ago
I tested the https://core.trac.wordpress.org/attachment/ticket/59250/59520-with-tests-and-comments.diff on the WordPress Core trunk, and it works perfectly.
Just one note: the .diff patch, in this case, has to be applied to the src folder instead of the main folder (it would be fine if you are using a regular WordPress install).
#8
follow-up:
↓ 9
@
2 years ago
Hi @xlthlx
I can't find the tests in the src folder. I am using this https://github.com/WordPress/wordpress-develop repo, where should I add the code?
#9
in reply to:
↑ 8
@
2 years ago
Replying to DaNish Ali:
Hi @danish-ali,
I hope I understood your question correctly: the tests are in the tests folder, not in the src one.
Hi @xlthlx
I can't find the tests in the src folder. I am using this https://github.com/WordPress/wordpress-develop repo, where should I add the code?
#10
@
2 years ago
@danish-ali When you are saving *.diff or *.patch into the root of the project, sometimes paths are not matching and instead of a command:
git apply 59520-with-tests-and-comments.diff
you have to make:
git apply --directory src 59520-with-tests-and-comments.diff
#11
in reply to:
↑ 3
@
2 years ago
I added the function on theme functions.php file. But I guess the new subject is not applied.
Replying to shooper:
Testing Instructions
These steps define how to test the feature or enhancement, and indicates the expected behavior or results.
Steps to Test
- Add function to functions.php:
<?PHP function updated_admin_email_subject() { return 'Filtered Admin Subject'; } add_filter('new_admin_email_subject', 'updated_admin_email_subject');
- Login to to wp-admin dashboard
- Go to the Settings > General page
- Change the Administration Email Address
- Click on Save Changes
Expected Results
Lists each expected result or behavior, i.e. what should happen when running the test(s):
- ✅ E-Mail Received with "Filtered Admin Subject" as the subject line
#12
@
2 years ago
In a fresh WordPress 6.4.2 installation I applied the following patch.diff and added the code listed in the Testing Instructions.
And it works perfectly.
This ticket was mentioned in PR #5865 on WordPress/wordpress-develop by @audrasjb.
2 years ago
#13
#14
@
2 years ago
- Keywords commit added; needs-testing removed
- Owner set to audrasjb
- Status changed from new to accepted
I tested the patch and it works fine.
Unit tests are passing.
Self assigning for commit.
@audrasjb commented on PR #5865:
2 years ago
#16
committed
Filter "new_admin_email_subject" added