【问题标题】:WooCommerce order status processing then send an email to custom email along with customerWooCommerce 订单状态处理然后将电子邮件与客户一起发送到自定义电子邮件
【发布时间】:2017-03-10 06:02:56
【问题描述】:

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

【问题讨论】:

  • 到目前为止你尝试了什么????

标签: php wordpress woocommerce hook-woocommerce email-notifications


【解决方案1】:

您可以使用挂钩的自定义函数 woocommerce_email_recipient_{$this->id} 过滤钩,定位 'customer_processing_order' 电子邮件通知,这种方式:

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

希望这会有所帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-08
    • 2016-03-03
    • 1970-01-01
    • 1970-01-01
    • 2018-09-19
    • 1970-01-01
    • 2014-03-09
    相关资源
    最近更新 更多