,你可以把你的functions.php如下:
add_filter('woocommerce_email_recipient_customer_completed_order', 'your_email_recipient_filter_function', 10, 2);
function your_email_recipient_filter_function($recipient, $object) {
$recipient = $recipient . ', [email protected]';
return $recipient;
}
唯一的缺点是,收件人将同时看到您的地址& 自己在:字段。
或者,建立在Steve的答案上,您可以使用 woocommerce_email_headers过滤器。通过$对象允许您 只有这适用于完成订单电子邮件:
add_filter('woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 2);
function mycustom_headers_filter_function($headers, $object) {
if ($object == 'customer_completed_order') {
$headers .= 'BCC: My name <[email protected]>' . "\r\n";
}
return $headers;
}
谢谢!我也在栈上找到了这个解决方案,并且昨天尝试了它,但是不起作用...现在它可以工作......也许是一个mailserver问题。 – user6573193
你最欢迎:) –