3
votes

I am struggling from a long time to change reply-to header for admin new order email. I want that when a new order is placed, the email which admin receives have reply-to header as customer email. Right now it is set as admin email. Whenever admin click reply for reply, that email will be sent to customer.

I tried to change From Address in woocommerce email settings but it effects on customer email header too.

Kindly suggest me how to do that.

1

1 Answers

5
votes

I believe you can do this with a filter. Your theme should have a functions.php file -- try adding the below to the top of that file somewhere:

add_filter( 'woocommerce_email_headers', 'add_reply_to_wc_admin_new_order', 10, 3 );

function add_reply_to_wc_admin_new_order( $headers = '', $id = '', $order ) {
    if ( $id == 'new_order' ) {
        $reply_to_email = $order->billing_email;
        $headers .= "Reply-to: <$reply_to_email>\r\n";
    }
    return $headers;
}