Custom Welcome Email | WordPress
I want to replace the following message when creating a user in the dashboard as an administrator:
Username: xxx
To set your password, visit the following address:
https://development.xxx.com/wp-login.php?action=rpkey=FlFdsDeAveg2EN1HuqGB0Glogin=xxx%40gmail.com
https://development.xxx.com/wp-login.php
This is my non-working function:
/**
* Custom Welcome Email
* @author Archie M
*
*/
add_filter( 'wpmu_signup_user_notification_subject', 'my_activation_subject', 10, 4 );
function my_activation_subject( $text ) {
return 'Welcome to xxx! (Activation required)';
}
add_filter('wpmu_signup_user_notification_email', 'my_custom_email_message', 10, 4);
function my_custom_email_message($message, $user, $user_email, $key) {
//Here is the new message:
$message = sprintf(__('Hi %s'), $user-display_name) . "\r\n\r\n";
$message .= __('Your registration on xxx has been approved.') . "\r\n\r\n";
$message .= __('To set your password, visit the following address:') . "\r\n\r\n";
$message .= '' . network_site_url("wp-login.php?action=rpkey=$keylogin=" . rawurlencode($user-user_login), 'login') . "\r\n\r\n";
return sprintf($message);
}
Where exactly am I missing the point?