Send email notification when an application password is added#9795
Send email notification when an application password is added#9795prasadkarmalkar wants to merge 3 commits intoWordPress:trunkfrom
Conversation
|
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. |
johnbillion
left a comment
There was a problem hiding this comment.
Thanks for the PR @prasadkarmalkar!
If you're willing to keep working on this then I have some feedback that I think will greatly improve this implementation. In general, this should look more like the existing wp_site_admin_email_change_notification() function. This means:
- This addition should be encapsulated into a new function that is hooked into the
wp_create_application_passwordaction, probably in default-filters.php and with the function itself in wp-includes/user.php. - A filter such as
send_application_password_created_emailshould be added so conditional logic can be performed to decide whether to send the email. Seesend_site_admin_email_change_emailas as example. - The email contents should use
###FIELD###placeholders instead of numbered placeholders to make the string easier to translate and more maintainable in the future. - The email parameters (to, subject, message, headers) should all pass through a filter. See
site_admin_email_change_emailas an example.
|
Hi @johnbillion, Thanks for the suggestions. I have updated the code as per the requested changes. |
This pull request enhances WordPress security by notifying users via email whenever a new application password is added to their account.
Trac ticket: https://core.trac.wordpress.org/ticket/63927
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.