将新订单电子邮件通知附件添加到供应商电子邮件
问题描述:
在WooCommerce中,我使用woocommerce-product-vendors作为多供应商插件。结帐后,我收到作为管理员一个新的订单电子邮件通知与附件(上传的文件)。将新订单电子邮件通知附件添加到供应商电子邮件
但供应商收到相同的电子邮件,但没有附件。我需要供应商也收到附件。
感谢
答
你可以试试这个代码与woocommerce_email_recipient_new_order
过滤钩子钩住的自定义函数:
add_filter('woocommerce_email_recipient_new_order', 'adding_vendor_email', 10, 2);
function adding_vendor_email($recipient, $order) {
// Your code or conditions to get the vendor email (if needed)
$recipient .= ",[email protected]";
return $recipient;
}
您将需要定制此自定义挂钩函数动态获取的电子邮件......
代码会出现在您的活动子主题(或主题)的function.php文件中,或者也包含在任何插件文件中。
该代码测试和工程
你也可以使用
woocommerce_email_attachments
过滤钩子......看到this related thread
非常感谢卢瓦克的支持我真的认识你是最棒的谢谢。 –