Remove the reply-to field from emails in WooCommerce

Remove the reply-to field from emails in WooCommerce on child sites.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'woocommerce_email_headers', 'filter_wc_remove_reply_to', 20, 3 );
function filter_wc_remove_reply_to( $header, $email_id, $order ) {

	$headers=explode("\n", $header);
	$newheaders=array();
	foreach ($headers as $line) {
		if (strncmp($line, "Reply-to", 8)!=0) {
			$newheaders[]=$line;
		}
	}
	return(implode("\n", $newheaders));
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.