Changing Woocommerce New Order “From” email address to customer email

I’m just after some coding help with a Woocommerce tweak a client needs on their WordPress site. We have a Woocommerce site that has just been set up as an enquiry system. When the customer places an order, the client gets a normal New Order notification by email.

However, we need the format of that email to be modified so that when the client get that email, they can reply to their customer’s email address, not their own site’s email address that was set in Woocommerce. (As it is normally, they would have to either forward it or copy/paste the contents of that email into a fresh email and put in the customers email address manually in order to respond.) They don’t want to have to do that.

Read More

How can I achieve this

many thanks in advance!

cheers,
Kurt

Related posts

Leave a Reply

2 comments

  1. The following snippet will only you to update the reply-to header for the New Order email:

    add_filter('woocommerce_email_header', 'spigot_reply_to_mail_filter', 11, 3);
    
    
    function spigot_reply_to_mail_filter($headers = '', $ordertype = 'new_order', $order = '') {
    
        if(!is_object($order) || empty($order) || $ordertype !== 'new_order') { return $headers; }
    
        $name = $order->get_billing_first_name().' '.$order->get_billing_last_name();
        $email = $order->get_billing_email();
    
        if(is_array($headers)) {
            $headers['Reply-To'] = "{$name} <{$email}>";
        } else {
            $headers .= "Reply-To: {$name} <{$email}>rn";
        }
        return $headers;
    }
    

    credit goes to: https://spigotdesign.com/change-woocommerce-new-order-reply-address-customer/