• Our website uses WPS Hide Login to change the URL for admin logins. However, the new user welcome email has started to pick up that URL instead of the standard https://website.com/my-account/ login.

    With the new update new users are no longer getting a temporary password emailed to them (that’s good) but there is a hash included in the url. Once users click on the link they are taken to a page that prompts them to update their password.

    I did a test by adding the hash to the ending of the standard login and it does work. My question is what’s the best way of going about modifying this email so it uses the https://website.com/my-account/ instead of the https://website.com/hidden-url.

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Use a filter to modify the new user email message:

    https://developer.www.ads-software.com/reference/hooks/wp_new_user_notification_email_admin/

    Or overwrite the wp_new_user_notification() function, it will probably look something like this:

    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')) . "\r\n\r\n";
            $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
            $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
    
            @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message);
    
            if ( empty($plaintext_pass) )
                return;
    
            $message  = __('Hi there,') . "\r\n\r\n";
    //Change the login message:
            $message .= sprintf(__("Welcome to %s! Here's how to log in:"), get_option('blogname')) . "\r\n\r\n";
    //Login URL can be changed here:
            $message .= wp_login_url() . "\r\n";
            $message .= sprintf(__('Username: %s'), $user_login) . "\r\n";
            $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n\r\n";
            $message .= sprintf(__('If you have any problems, please contact me at %s.'), get_option('admin_email')) . "\r\n\r\n";
            $message .= __('Thanks!!');
    
            wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message);
    
        }

    Note: Use always a local dev environment to test code, never on your production site.

Viewing 1 replies (of 1 total)
  • The topic ‘Welcome Login Details Email URL Change’ is closed to new replies.