Reputation: 9
I want to send e-mails to user account email and not to billing email in WooCommerce.
I only found that code but I think this is outdated and I also don't want to send 2 mails only one to customer user email.
Code here:
https://www.webdesign101.net/send-e-mails-user-account-email-billing-email-woocommerce/
Tried this code but outdated and also 2 mails instead of one going to user email.
And I didn't found the line in woocommerce/templates/email to change the header from billing_email
to user_email
.
I want so send emails from WooCommerce to user email not to billing email.
Upvotes: 0
Views: 916
Reputation: 11841
function wc_change_new_order_email_recipient($recipient, $order) {
global $woocommerce;
$user = $order->get_user();
$recipient[] = $user->user_email;
return $recipient;
}
add_filter('woocommerce_email_recipient_new_order', 'wc_change_new_order_email_recipient', 10, 2);
Upvotes: 0