• Resolved salesfunnelguy

    (@akshayrox123)


    Hello,
    great plugin, There is one issue.
    Every address has its email ID field. And While after purchase, the email contains the selected address’s email ID. Which is fine. But The main email of the account is not been showed. As in the main login/ registered mail.
    How can we do that ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Matt Harrison

    (@matt-h-1)

    I don’t think that would be possible with this plugin.

    WooCommerce without this Address Book plugin works the same.

    When you are checking out you can change the Billing Address email and order confirmations are sent to the Billing Address email and not the user’s email address.

    So that is how WooCommerce works, and this Address Book plugin doesn’t change that.

    Thread Starter salesfunnelguy

    (@akshayrox123)

    Actually no,
    In woocommerce > Orders > Order Details > Customer email is showed with the selected address as billing address and shipping address.
    So, Lets take a scenario, and a very good usecase for this plugin. If a site has no registration but agent system going door to door and taking orders, Filling the address of the customer. The operation team gets the notification of the order in the mail.
    But to check the agent’s name, they have to go to the wordpress admin panel.

    Thread Starter salesfunnelguy

    (@akshayrox123)

    is there any solution?

    Plugin Author Matt Harrison

    (@matt-h-1)

    I’m more confused about what you are seeing then. I did test it just to make sure and Billing Address Email can always be different from Customer Email. It works exactly the same with the Address Book plugin as it does without the Address Book plugin. WooCommerce has no functionality for Customer Email in order confirmation notices.

    I do understand your sample scenario, but that same thing would happen if you did it without the Address Book plugin just entering the new address each time when placing the order. The only benefit of the Address Book plugin would be to save the addresses for use again on another order.. Although with an agent going door to door the select of addresses could get pretty big saving all of those addresses.

    It does sound like a useful feature for WooCommerce if you want to setup a site like you described to be able to include the customer and/or email in addition to a billing email in the order notification emails. However, that doesn’t relate to this Address Book plugin’s functionality.

    It could be built out as another plugin to do what you are looking for, or it might be possible just by customizing your email templates if you can include the customer email in there: https://woocommerce.com/posts/how-to-customize-emails-in-woocommerce/

    I just threw together a quick filter which will customize the email to add the customer’s email to the email template which could give you a start on doing this customization.

    
    add_action( 'woocommerce_email_after_order_table', 'custom_email_after_order_table', 10, 4 );
    function custom_email_after_order_table( $order, $sent_to_admin, $plain_text, $email ) {
    	$customer_id = $order->get_customer_id();
    	if (! empty($customer_id)) {
    		$customer = new WC_Customer($customer_id);
    		$customer_email = $customer->get_email();
    		if (! empty($customer_email) && $customer_email != $email) {
    			echo '<p>Order placed by: ' . $customer_email . '</p>';
    		}
    	}
    }
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Email of the main account in woocommerce order confirmation email’ is closed to new replies.