[英]Woocommerce BCC on order email to admin
When someone makes an order in woocommerce, you get an email of the order as the administrator. 当有人在woocommerce中下订单时,您会收到一封订单的电子邮件作为管理员。 I'd like to add additional recipients for this email.
我想为此电子邮件添加其他收件人。 However!
然而! I'd only like this extra BCC to be made on these exact mails.
我只想在这些确切的邮件上加上这个额外的BCC。 Not all the other mails going through.
并非所有其他邮件都通过。
What is said in this thread applies to all mails, and not specificly the order emails that the admin gets: Additional recipients on woocommerce invoice 此主题中的内容适用于所有邮件,而不是特定于管理员获取的订单电子邮件: woocommerce发票上的其他收件人
Try this code: 试试这段代码:
add_filter( 'woocommerce_email_headers', 'add_bcc_to_wc_admin_new_order', 10, 3 );
function add_bcc_to_wc_admin_new_order( $headers = '', $id = '', $wc_email = array() ) {
if ( $id == 'new_order' ) {
$headers .= "Bcc: my_personal@email.com\r\n"; // replace my_personal@email.com with your email
}
return $headers;
}
This code is tested in WC 2.1 此代码在WC 2.1中进行了测试
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.