WooCommerce 订单状态处理然后将电子邮件与客户一起发送到自定义电子邮件

WooCommerce order status processing then send an email to custom email along with customer

我想在订单状态更改为处理中时向自定义电子邮件地址发送电子邮件以及客户电子邮件 ID。

You can use a custom function hooked in woocommerce_email_recipient_{$this->id} filter hook, targeting 'customer_processing_order' email notification, this way:

add_filter('woocommerce_email_recipient_customer_processing_order', 'wh_OrderProcessRecep', 10, 2);

function wh_OrderProcessRecep($recipient, $order)
{
    // Set HERE your email adresses
    $custom_email = 'mycustomemail@domain.com';

    $recipient = $recipient . ', ' . $custom_email;
    return $recipient;
}

代码进入您的活动子主题(或主题)的 function.php 文件。或者在任何插件 php 文件中。

参考:

  1. Adding a second email address to a completed order in WooCommerce
  2. Customising WooCommerce notification emails with hooks and filters
  3. WooCommerce email notifications: different email recipient for different cities

希望对您有所帮助!