Add the New order email notification attachment to the vendor email

大憨熊 提交于 2019-12-05 14:30:27

You could try this code with a custom function hooked in woocommerce_email_recipient_new_order filter hook:

add_filter('woocommerce_email_recipient_new_order', 'adding_vendor_email', 10, 2);
function adding_vendor_email( $recipient, $order ) {
    if ( ! is_a( $order, 'WC_Order' ) ) return $recipient; // (Optional)

    // Your code or conditions to get the vendor email (if needed)

    $recipient .= ",vendor@yourdomain.com";
    return $recipient;
}

You will need to customize this custom hooked function to get the email dynamically…

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

This code is tested and works

You could also use woocommerce_email_attachments filter hook… see this related thread

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