简体   繁体   English

WooCommerce BCC将完整的订单邮件发送给客户

[英]WooCommerce BCC on complete order mail to customer

When someone makes an order in woocommerce, he gets also an email when the order is complete. 当某人在woocommerce下订单时,订单完成后也会收到一封电子邮件。 I'd like to add additional recipients for this email. 我想为此电子邮件添加其他收件人。 However! 然而! I'd only like this extra BCC to be made on these exact mails. 我只想在这些确切的邮件上加上这个额外的密件抄送。 Not all the other mails going through. 并非所有其他邮件都通过。

It's something like this, but then with the correct filter / name: add_bcc_to_wc. 就像这样,但是要使用正确的过滤器/名称: add_bcc_to_wc. ... ...

add_filter( 'woocommerce_email_headers', 'add_bcc_to_wc_admin_new_order', 10, 3 );
    function add_bcc_to_wc_admin_new_order( $headers = '', $id = '', $wc_email = array() ) {
        if ( $id == 'new_order' ) {
            $headers .= "Bcc: my_personal@email.com\r\n"; // replace my_personal@email.com with your email
        }
        return $headers;
    }

With kind regards, Dennis 亲切的问候,丹尼斯

Add bcc e-mail to customer order confirmation 将密件抄送电子邮件添加到客户订单确认中

add_filter( 'woocommerce_email_headers', 'firefog_headers_filter_function', 10, 2);
        function firefog_headers_filter_function( $headers, $object ) {
            if ($object == 'new_order') {
                $headers .= 'BCC: NAME <name@domain.com>' . "\r\n";
            }

            return $headers;
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM