您可以将以下内容放入您的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] /cdn-cgi/l/email-protection';
return $recipient;
}
唯一的缺点是收件人会在“收件人:”字段中看到您的地址和他自己的地址。
或者,您可以使用 woocommerce_email_headers 过滤器。传递的 $object 允许您仅将其应用于已完成的订单电子邮件:
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] /cdn-cgi/l/email-protection>' . "\r\n";
}
return $headers;
}
取自这个答案 https://wordpress.stackexchange.com/a/92030/102229 from Ewout https://wordpress.stackexchange.com/users/26106/ewout.