Repository navigation
Users: Show the proposed address in the admin email change confirmation. - #13957
Vedanshmini26 wants to merge 1 commit into
Conversation
The confirmation email sent when the site or network admin email address is changed only mentioned the proposed new address as "This email has been sent to ###EMAIL###", which does not make clear that it is the address being requested. The email now states the new address explicitly. A `###NEW_EMAIL###` placeholder is introduced for the `new_admin_email_content` and `new_network_admin_email_content` filters. The `###EMAIL###` placeholder is deprecated but still replaced, so existing filtered email content keeps working. Fixes #43706.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
When the site admin email address is changed, the confirmation email only mentions the proposed new address in its last line: "This email has been sent to ###EMAIL###". Nothing tells the recipient that this is the address being requested. That matters most when the change wasn't expected, because the recipient can't tell what they would be approving.
This PR states the new address explicitly and follows the approach suggested in comment 13 for keeping existing customizations working.
update_option_new_admin_email()): adds "The new administration email address will be: ###NEW_EMAIL###" and removes the ambiguous "This email has been sent to" line.update_network_option_new_admin_email()): sends the same kind of email with the same ambiguous line, so it gets the same fix ("...changed to: ###NEW_EMAIL###"). Changing both strings in one release means translators only update this text once, as noted in comment 14.###NEW_EMAIL###placeholder for thenew_admin_email_contentandnew_network_admin_email_contentfilters.###EMAIL###is documented as deprecated. Right after each filter runs, it is converted to###NEW_EMAIL###, so filtered email content that still uses###EMAIL###keeps working unchanged.Testing Instructions
Automated:
The tests cover the default email content (it includes the new address and leaves no unreplaced placeholders) and filtered content using
###NEW_EMAIL###or the deprecated###EMAIL###, for both the site and the network email.Manual:
###EMAIL###:add_filter( 'new_admin_email_content', fn() => 'Confirm ###EMAIL###' );Repeat step 1. The email reads "Confirm ".
Trac ticket: https://core.trac.wordpress.org/ticket/43706