Wp_new_user_notification doesn’t work

I have tried unsuccessfully to replace the email template for user & password.

I will explain what I have done based on the documentation and what I have seen here in this forum:

I have created my own plugin with the following code:

if ( !function_exists('wp_new_user_notification') ) {     function wp_new_user_notification( $  user_id, $  plaintext_pass = '' ) {         $  user = new WP_User($  user_id);            $  user_login = stripslashes($  user->user_login);         $  user_email = stripslashes($  user->user_email);            $  message  = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "rnrn";         $  message .= sprintf(__('Username: %s'), $  user_login) . "rnrn";         $  message .= sprintf(__('E-mail: %s'), $  user_email) . "rn";            @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $  message);            if ( empty($  plaintext_pass) )             return;            $  message  = __('Hi there,') . "rnrn";         $  message .= sprintf(__("Welcome to %s! Here's how to log in:"), get_option('blogname')) . "rnrn";         $  message .= wp_login_url() . "rn";         $  message .= sprintf(__('Username: %s'), $  user_login) . "rn";         $  message .= sprintf(__('Password: %s'), $  plaintext_pass) . "rnrn";         $  message .= sprintf(__('If you have any problems, please contact me at %s.'), get_option('admin_email')) . "rnrn";         $  message .= __('Adios!');            wp_mail($  user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $  message);        } }  

I have also added the following filter using the code snippets plugin:

add_filter( 'wp_new_user_notification_email', 'custom_wp_new_user_notification_email', 10, 3 );  function custom_wp_new_user_notification_email( $  wp_new_user_notification_email, $  user, $  blogname ) {    // filter stuff in $  wp_new_user_notification_email here    return $  wp_new_user_notification_email; } 

Finally I inserted the same plugin code in a php file called user-email.php in the following path:

/wp-content/mu-plugin/user-email.php

 if ( !function_exists('wp_new_user_notification') ) {     function wp_new_user_notification( $  user_id, $  plaintext_pass = '' ) {         $  user = new WP_User($  user_id);            $  user_login = stripslashes($  user->user_login);         $  user_email = stripslashes($  user->user_email);            $  message  = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "rnrn";         $  message .= sprintf(__('Username: %s'), $  user_login) . "rnrn";         $  message .= sprintf(__('E-mail: %s'), $  user_email) . "rn";            @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $  message);            if ( empty($  plaintext_pass) )             return;            $  message  = __('Hi there,') . "rnrn";         $  message .= sprintf(__("Welcome to %s! Here's how to log in:"), get_option('blogname')) . "rnrn";         $  message .= wp_login_url() . "rn";         $  message .= sprintf(__('Username: %s'), $  user_login) . "rn";         $  message .= sprintf(__('Password: %s'), $  plaintext_pass) . "rnrn";         $  message .= sprintf(__('If you have any problems, please contact me at %s.'), get_option('admin_email')) . "rnrn";         $  message .= __('Adios!');            wp_mail($  user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $  message);        } } 

None of the options mentioned above has worked and the "Your username and password info" default email is the one that keeps coming. I’m already a bit worried because apparently this is the only possible solution for this case.

Does anyone have any idea that it may be failing?