Woocommerce 商业发票上的其他收件人

Woocommerce 商业发票上的其他收件人,woocommerce,Woocommerce,是否有办法将其他收件人添加到电子商务发票邮件中。 我尝试使用“woocommerce\u email\u headers”钩子,但不起作用: add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 2); function mycustom_headers_filter_function($headers, $object) { $headers = array(); $h

是否有办法将其他收件人添加到电子商务发票邮件中。 我尝试使用“woocommerce\u email\u headers”钩子,但不起作用:

add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 2);

function mycustom_headers_filter_function($headers, $object) {
    $headers = array();
    $headers[] = 'Bcc: My Name <me@gmail.com>';
    $headers[] = 'Content-Type: text/html';
    return $headers;
}
add_filter('woocommerce_email_headers','mycustom_headers_filter_function',10,2);
函数mycustom\u headers\u filter\u函数($headers,$object){
$headers=array();
$headers[]=“密件抄送:我的名字”;
$headers[]=“内容类型:text/html”;
返回$headers;
}

有什么建议吗?

几个月后,但我希望这会对某人有所帮助

add_filter('woocommerce_email_headers', 'woo_cc_emails');
function woo_cc_emails() {
  return 'Bcc: your@email.here' . "\r\n";
}

您可以使用“To”或“Cc”更改“Bcc”。

您也可以扩展该功能以包括订单:

add_filter( 'woocommerce_email_headers', 'woo_cc_emails', 10, 3 );

function woo_cc_emails( $headers, $status, $object ) {
    return 'Bcc: your@email.here' . "\r\n";
}

我需要帮助将密件抄送添加到新客户帐户电子邮件中。这是我想到的。和上面的稍有不同。希望这对别人有帮助

add_filter( 'woocommerce_email_headers', 'add_bcc_to_wc_customer_new_account', 10, 3 );
function add_bcc_to_wc_customer_new_account( $headers = '', $id = '', $wc_email = array() ) {
if ( $id == 'customer_new_account' ) {
    $headers .= "Bcc: my_personal@email.com\r\n"; // replace my_personal@email.com with your email
}
return $headers;
}

请您解释一下我如何使用此选项将多个地址添加到密件抄送字段中?以下操作应该有效:
return'密件抄送:your@email.here, another@email.com, and@another.com' . “\r\n”