Viewing 1 replies (of 1 total)
  • Plugin Author Sajjad Hossain Sagor

    (@sajjad67)

    You can use the get_user_by function to get that user data, in your case first name and last name… Example : add this in the functions.php and you can get the first and last name value to add in your email body!!

    add_filter( "wp_username_changed_email_body", "your_function" );
    
    function your_function( $old_username, $new_username )
    {
        $email_body = "Your custom email text body.";
        $user = get_user_by( 'login', $new_username );
        
        if( $user )
        {
          $first_name=$user->first_name;
          $lastname = $user->last_name;
        }
        return $email_body;
    }
Viewing 1 replies (of 1 total)

The topic ‘Add First Name & Last Name’ is closed to new replies.