All order email sending to CUSTOMER from default woocommerce email address, for example, [email protected]
and this is OK, but I want add a reply email address for these emails, so user able to reply this custom address, such as [email protected]
.
Also I want set this reply email address based on $order
shipping method. If shipping method is 'local_pickup_plus
' set reply address to [email protected]
, else set [email protected]
.
I figure out, I can modify headers with woocommerce_email_headers
filter, but only for email sent to the admin.
add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 3);
function mycustom_headers_filter_function( $headers, $object, $order ) {
if ($object == 'new_order') {
$headers .= 'Reply-to: [email protected]';
}
return $headers;
}
How can I set this for customer emails?