Skip to content

Conversation

@JanThiel
Copy link

Allow selective sending of the "New User" Mails to admins and users by extending the existing filters by a send flag.
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.

Copy link
Contributor

@peterwilsoncc peterwilsoncc left a 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 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$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 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$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,
Copy link
Contributor

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.

Comment on lines +2034 to +2035
* Filters whether the Admin notification about a new user registration should be send or not.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.
*

Comment on lines +2092 to +2093
* Filters whether the User notification about a new user registration should be send or not.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.
*

@johnbillion
Copy link
Member

Closing this in favour of #2586 which is ahead. Thanks everyone!

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.

4 participants