【发布时间】:2021-11-05 22:04:33
【问题描述】:
默认情况下,WooCommerce 仅向客户发送暂停订单通知(不知道为什么,因为让商店经理知道订单何时暂停非常重要......)
根据我在这里和 Google 上发现的研究线程,我尝试在我的子主题的 functions.php 中实现以下 sn-ps:Send on-hold order status email notification to admin
add_filter( 'woocommerce_email_headers', 'custom_admin_email_notification', 10, 3);
function custom_admin_email_notification( $headers, $email_id, $order ) {
if( 'customer_on-hold_order' == $email_id ){
// Set HERE the Admin email
$headers .= 'Bcc: My name <my@email.com>\r\n';
}
return $headers;
}
我还尝试了来自同一线程的以下 sn-p:
// Send on-hold order status email notification to admin
add_filter( 'woocommerce_email_headers', 'custom_admin_email_notification', 10, 3);
function custom_admin_email_notification( $headers, $email_id, $order ) {
if( strpos($email_id,'hold') > 0 ){
$headers .= 'Bcc: Admin User <admin@example.com>'. "\r\n";
}
return $headers;
}
当订单从待付款更改为暂停时,这些似乎都不起作用。是的,我已将 sn-ps 中的电子邮件更改为我的管理员电子邮件。我正在寻找一种解决方案,当这种情况自动发生(从待付款到暂停)或在编辑订单时手动发生时,管理员将在客户暂停电子邮件中被密件抄送。
【问题讨论】:
标签: php wordpress woocommerce email-notifications