Skip to content

Instantly share code, notes, and snippets.

@alewolf
Created August 21, 2018 05:34
Show Gist options
  • Save alewolf/6b1a63e1185f1e97a50789d793f864ab to your computer and use it in GitHub Desktop.
Save alewolf/6b1a63e1185f1e97a50789d793f864ab to your computer and use it in GitHub Desktop.
<?php
// replace reply-to email address for WooCommerce customer emails
add_filter( 'woocommerce_email_headers', 'new_customer_order_reply_to_email_address', 20, 3 );
function new_customer_order_reply_to_email_address( $header, $email_id ) {
$customer_email_ids = array(
'customer_on_hold_order',
'customer_processing_order',
'customer_completed_order',
'customer_invoice',
'customer_new_account',
'customer_note',
'customer_refunded_order',
'customer_reset_password',
);
if ( in_array( $email_id, $customer_email_ids ) ) {
$header .= 'Reply-to: <[email protected]>\r\n';
}
return $header;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment