有一堆example使用这个woocommerce钩子woocommerce_email_recipient_customer_completed_order
。所以我将它添加到functions.php中,并将几个示例收件人连接起来作为测试,但只有购买者会收到一封电子邮件。它似乎并没有像这个过滤器被调用,因为如果我打开调试和error_log(...)
日志文件中没有任何东西。woocommerce_email_recipient_customer_completed_order没有被调用的钩子
这是不是有工作原因?我试图将优先级提高到99,但这也不起作用。该网站使用所有默认设置,并且不覆盖任何模板。
add_filter('woocommerce_email_recipient_customer_completed_order', 'custom_woocommerce_add_email_recipient', 10, 2);
function custom_woocommerce_add_email_recipient($recipient, $order) {
$recipient = $recipient . ', [email protected], [email protected]';
return $recipient;
}
请问,这不是好的行为和公平的方式,所以无论如何我删除我的答案... – LoicTheAztec