Send on-hold order status email notification to admin

旧城冷巷雨未停 提交于 2019-12-01 07:04:28
LoicTheAztec

The correct $email_id for "on-hold" order status email notification is 'customer_on-hold_order'.

So your code is going to be:

add_filter( 'woocommerce_email_headers', 'custom_admin_email_notification', 10, 3);
function custom_admin_email_notification( $headers, $email_id, $order ) {

    if( 'customer_on-hold_order' == $email_id ){
        // Set HERE the Admin email
        $headers .= 'Bcc: My name <my@email.com>\r\n';
    }
    return $headers;
}

Code goes in function.php file of your active child theme (or theme) or also in any plugin file.

Code is tested and works.


Similar answers: How to get order ID in woocommerce_email_headers hook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!