Reply To: i want first name and last name in confirmation email

Home Forums User Registration i want first name and last name in confirmation email Reply To: i want first name and last name in confirmation email

#15133

sanjeev3
Member

Hi Jasmeet,

Please note that for the {{first_name}} and {{last_name}} to get parsed correctly, you need to have default First Name and Last Name field in your registration form. Also, make sure you are using user registration version 1.5.0 or greater.

To auto login after email confirmation, use this user_registration_check_token_complete hook instead. Add the following codes to your child theme’s functions.php

function ur_auto_login( $user_id, $status ) {
    if( true == $status ) {
         wp_set_current_user( $user_id );
         wp_set_auth_cookie( $user_id );
    }
}
add_action( 'user_registration_check_token_complete', 'ur_auto_login', 10, 2 );

Also, DO NOT add any codes to plugin files directly, as it will be removed on plugin updates.