【问题标题】:Additional email addresses to on hold status email notification for BACS paymentsBACS 付款暂停状态电子邮件通知的其他电子邮件地址
【发布时间】:2017-06-19 23:36:07
【问题描述】:

在 WooCommerce 中,我希望在“保留”电子邮件通知中添加 2 个额外的电子邮件地址(首选密件抄送),以便可以监控它们的付款情况。

适用于任何使用 BACS 的订单,以便通知相关人员密切关注。我可以找到各种订单完成但不是保留电子邮件。

任何帮助将不胜感激。

谢谢

【问题讨论】:

    标签: php wordpress woocommerce orders email-notifications


    【解决方案1】:

    可以使用挂在 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 文件或任何插件文件中。


    相关答案:

    【讨论】:

    • 恐怕好像没用。仍然只能收到标准电子邮件。
    猜你喜欢
    • 2021-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-14
    • 1970-01-01
    • 2019-01-12
    • 2016-07-27
    • 2019-01-22
    相关资源
    最近更新 更多