When changing user data in WooCommerce, an email is sent to the administrator. How can I put the user's name in the subject line of the "$ subject" letter? Here is a piece of code:

function woocommerce_send_notification(){ $body = ''; $to = 'email@domain.com'; $subject = 'Смена данных Имя Фамилия'; $curr_user = wp_get_current_user(); $user_id = $curr_user->ID; $curr_username = $curr_user->data->user_login; 

    1 answer 1

    All user data is in the $curr_user object.

     function woocommerce_send_notification() { $body = ''; $to = 'email@domain.com'; $curr_user = wp_get_current_user(); $subject = 'Смена данных: ' . $curr_user->first_name . ' ' . $curr_user->last_name; $user_id = $curr_user->ID; $curr_username = $curr_user->data->user_login; } 
    • one
      Thanks for the answer! Everything is working. - Dimitry