Created
July 7, 2020 19:06
-
-
Save wilnaweb/86a718509bbdbbe3fb5c8c899182ef70 to your computer and use it in GitHub Desktop.
Wordpress - Update E-mail New User Notify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mb_wp_new_user_notification_email($wp_new_user_notification_email,$user,$blogname) { | |
$newpass = wp_generate_password( 10, true, false ); | |
wp_set_password($newpass,$user->ID); | |
$message = sprintf(mb__( "Parceiro, seja bem vindo a Brasil, abaixo seguem os dados de acesso:" ), $blogname ) . "\r\n"; | |
$message .= wp_login_url() . "\r\n"; | |
$message .= sprintf(mb__( 'Usuário: %s' ), $user->user_login ) . "\r\n"; | |
$message .= sprintf(mb__( 'Senha: %s' ), $newpass) . "\r\n\r\n"; | |
$message .= sprintf(mb__( 'Caso tenha algum problema, entre em contato com o suporte através do e-mail: %s.'), get_option( 'admin_email' ) ) . "\r\n"; | |
$message .= __('Brasil'); | |
//$wp_new_user_notification_email['message'] = $message; | |
//echo $message; | |
return wp_mail($wp_new_user_notification_email, sprintf(__('[%s] | O seu usuário e senha'), get_option('blogname')), $message); | |
//return $wp_new_user_notification_email; | |
} | |
add_filter( 'wp_new_user_notification_email' , 'mb_wp_new_user_notification_email', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment