在WooCommerce中,我希望有在“等待”电子邮件通知,2个额外的电子邮件地址(首选。密件抄送),以便对他们的付款进行监控。
对于任何使用BACS的订单,都可以通知相关人员密切关注。我可以找到所有种类的订单完成,但不在等待电子邮件。
任何帮助都将不胜感激。
谢谢
发布于 2017-02-03 14:49:04
可以使用woocommerce_email_headers过滤器钩子中的自定义函数钩子,如下所示:
add_filter( 'woocommerce_email_headers', 'custom_admin_email_notification', 10, 3);
function custom_admin_email_notification( $headers, $email_id, $order ) {
// Targeting "on hold" order status only with BACS payments
if( 'customer_on-hold_order' == $email_id && 'bacs' == get_post_meta($order->id, '_payment_method', true) ){
// Set HERE your additionals emails in this array:
$emails = array('Name1 <name1@email.com>', 'Name2 <name2@email.com>');
// Adding the new emails to 'Bcc' headers
$headers .= 'Bcc: '.implode(',', $emails).'\r\n';
}
return $headers;
}代码放在活动子主题(或主题)的function.php文件中,也可以放在任何插件文件中。
相关答案:
https://stackoverflow.com/questions/42009992
复制相似问题