2

I would like the site's administrator doesn't receive a new user's registration email when the administrator himself uses the admin interface to add a user.

How can I limit sending a email only when a user completes the registration form ?

// If the registration form was completed by a user ...

add_action( 'user_register', 'user_registration_save', 10, 1 );
function user_registration_save( $user_id ) {
   $to = '';
   $subject = 'New register with the form';
   $message .= "Identifiant : " . $user->user_login . "\r\n\r\n";
   $message .= "E-mail : " . $user->user_email;
   wp_mail( $to, $subject, $message );
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.