-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Allow selective sending of the "New User" Mails to admins and users #2202
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
Allow selective sending of the "New User" Mails to admins and users #2202
Conversation
peterwilsoncc
left a comment
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.
A few coding suggestions and a question inline.
| * | ||
| * @param WP_User $user User object for new user. | ||
| */ | ||
| $send_notification_to_admin = apply_filters( 'send_new_user_notification_email_to_admin', true, $user ); |
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.
| $send_notification_to_admin = apply_filters( 'send_new_user_notification_email_to_admin', true, $user ); | |
| $send_notification_to_admin = apply_filters( 'wp_send_new_user_notification_to_admin', true, $user ); |
| * | ||
| * @param WP_User $user User object for new user. | ||
| */ | ||
| $send_notification_to_user = apply_filters( 'send_new_user_notification_email_to_user', true, $user ); |
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.
| $send_notification_to_user = apply_filters( 'send_new_user_notification_email_to_user', true, $user ); | |
| $send_notification_to_user = apply_filters( 'wp_send_new_user_notification_to_user', true, $user ); |
| 'subject' => __( '[%s] Login Details' ), | ||
| 'message' => $message, | ||
| 'headers' => '', | ||
| 'send' => true, |
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.
I'm unclear what this is for, where is it used in wp_mail()?
🔢 This applies to both set of arguments: for user and admin.
| * Filters whether the Admin notification about a new user registration should be send or not. | ||
| * |
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.
| * Filters whether the Admin notification about a new user registration should be send or not. | |
| * | |
| * Filters whether the Admin is notified of a new user registration. | |
| * |
| * Filters whether the User notification about a new user registration should be send or not. | ||
| * |
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.
| * Filters whether the User notification about a new user registration should be send or not. | |
| * | |
| * Filters whether the User is notified of a new user registration. | |
| * |
|
Closing this in favour of #2586 which is ahead. Thanks everyone! |
Allow selective sending of the "New User" Mails to admins and users by extending the existing filters by a
sendflag.This allows filters to skip mail sending based on the context and user information.
Trac ticket: https://core.trac.wordpress.org/ticket/54874
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.