Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress send reset password link inside wp_new_user_notification_email

// CHANGE DEFAULT MAIL FOR NEW USER REGISTRATION / RESET PASSWORD 
add_filter('wp_new_user_notification_email', 'change_notification_message', 10, 3);
    function change_notification_message( $wp_new_user_notification_email, $user, $blogname ) {
        // Generate a new key
        $key = get_password_reset_key( $user );
        // Set the subject
        $wp_new_user_notification_email['subject'] = __('Your email subject');
        // Put the username in the message
        $message = sprintf(__('Username: %s'), $user->user_login) . "

";
        // Give your user the link to reset her password 
        $message .= __('To set your password, visit the following address:') . "

";
        $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user->user_login), 'login') . ">

";
        $message .= wp_login_url() . "
";

        // Set the email's message
        $wp_new_user_notification_email['message'] = $message;

        return $wp_new_user_notification_email;
    }
Source by wordpress.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #wordpress #send #reset #password #link
ADD COMMENT
Topic
Name
9+3 =