有一堆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