Use case:
I want to send an email notification to the admin or the sales staff whenever someone signup as customer on my Woocommerce Shop.
Details I want to include: Name, Phone Number, Email Address.
I'm already taking phone number while registration as billing_phone
Issue
The snippet mentioned below sends email address only. Not the NAME or the Phone Number.
I want send the Phone number, email and name to the any given email of the staff. Can you help me with this?
function so174837_registration_email_alert( $user_id ) {
$user = get_userdata( $user_id );
$email = $user->user_email;
$name = $user->user_email;
$phone = get_user_meta( $customer_id, 'billing_phone', true );
$message = $name.''.$email .' - ' .$phone. 'has registered to your website.';
$subject1= $name. ' - '.$phone .'just signed up. Call him.';
wp_mail( 'xxy@gmail.com', $subject1, $message );
}add_action('user_register', 'so174837_registration_email_alert');