Skip to content

Users: Show the proposed address in the admin email change confirmation. - #13957

Open
Vedanshmini26 wants to merge 1 commit into
WordPress:trunkfrom
Vedanshmini26:enhancement/43706-admin-email-change-new-address
Open

Vedanshmini26 wants to merge 1 commit into
WordPress:trunkfrom
Vedanshmini26:enhancement/43706-admin-email-change-new-address

Conversation

@Vedanshmini26

Copy link
Copy Markdown

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.

  • Site admin email (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.
  • Network admin email (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 ###NEW_EMAIL### placeholder for the new_admin_email_content and new_network_admin_email_content filters.
  • Backward compatibility: ###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:

npm run test:php -- --filter UpdateOptionNewAdminEmail
npm run test:php -- -c tests/phpunit/multisite.xml --filter UpdateNetworkOptionNewAdminEmail

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:

  1. Go to Settings > General, change "Administration Email Address" and save.
  2. Check the confirmation email sent to the new address, for example with a mail-logging plugin. It now says "The new administration email address will be:" followed by the new address.
  3. Add a filter that returns custom text containing ###EMAIL###:
    add_filter( 'new_admin_email_content', fn() => 'Confirm ###EMAIL###' );
    Repeat step 1. The email reads "Confirm ".
  4. On multisite, repeat steps 1–2 from Network Admin > Settings with "Network Admin Email".

Trac ticket: https://core.trac.wordpress.org/ticket/43706

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.
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props sheldorofazeroth.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant