以下代码段将仅让您更新新订单电子邮件的回复标题:
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}>\r\n";
}
return $headers;
}
归功于:https ://spigotdesign.com/change-woocommerce-new-order-reply-address-customer/