• Hi There, while this is in regard to WooCommerce, the fields I’m referring to are WordPress user fields so I’m hoping to get some help here as the support here is far superior 🙂

    I’ve been trying to add three fields under “Customer Details” on the New Order email notification sent to the Admin (admin-new-order.php) but I’m having no success, obviously calling it correctly is too advanced for the likes of me!

    Here is the admin-new-order.php code if that helps: https://github.com/woothemes/woocommerce/blob/master/templates/emails/admin-new-order.php

    Basically what my customer wants is these three fields to write to the Admin New Order email:

    Account: [$user_login]
    Name: [$display_name]
    Email: [$user_email]

    While the existing order template does have the $billing_email, I have an issue with that aspect of the WooCommerce framework as customers can edit the $billing_email field in My Account yet it doesn’t update their actual $user_email, hence creating two different email addresses on file and hence why I don’t want the user identification in the New Order email to be reliant upon the $billing_email (I have created a custom Frontend Edit Profile so users can edit $user_email so nobody need worry about helping me with that, thanks).

    Can anyone help, please? I’m sure it’s very simple! 😉 Here is one example of the MANY things I tried:

    add_action( 'get_user_details', 10, 2 );
    function get_user_details( $user_id, $user_login, $display_name, $user_email )
    {
    	$user = get_userdata( $user_id );
    	echo '<p><strong>Account:</strong>'.$user_login.'</br>';
    	echo '<p><strong>Name:</strong>'.$display_name.'</br>';
    	echo '<p><strong>Email:</strong>'.$user_email.'</p>';
    }
  • The topic ‘[Plugin: WooCommerce] New Order Email’ is closed to new replies.