简体   繁体   English

发送有关保留的Woocommerce订单的客户处理订单电子邮件通知

[英]Send customer processing order email notification for on-hold Woocommerce orders

If a customer places an order via bacs gateway, the order status is "on-hold" and the customer recieves the accompanying mail-notification with bank details. 如果客户通过bacs网关下订单,则订单状态为“待定”,并且客户会收到随附的带有银行详细信息的邮件通知。 After payment is done, customer receives another email - almost with the same content as before: customer_processing_order 付款完成后,客户会收到另一封电子邮件-内容几乎与以前相同:customer_processing_order

My goal: 我的目标:

Disable the mail for on-hold-orders (this is a default function in the backend) and send the email which is actually meant for paid-orders which carry the status "processing" also in case of an order with (on-hold-status) whilst keeping it also in place for customer-processing-orders. 禁用挂起订单的邮件(这是后端的默认功能),并发送实际用于付费订单的电子邮件,如果订单中包含(挂起-状态),同时也将其保留给客户处理订单。

In other words: New orders with status "on-hold" and "processing" should share the same email-template. 换句话说:状态为“保留”和“处理中”的新订单应共享相同的电子邮件模板。

Is this somehow possible to achieve? 这有可能实现吗?

my rather poor try so far (based on another helpful solution): 到目前为止,我的尝试相当糟糕(基于另一个有用的解决方案):

function unhook_new_order_processing_emails( $email_class ) {
    // Turn off pending to processing for now
    remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
    // Turn it back on but send the on-hold email
    add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_On_Hold_Order'], 'trigger' ) );
}

Thanks in advance for your help! 在此先感谢您的帮助!

If you have disabled customer "on-hold" email notifications, you can use the following to send an email notification for on-hold orders status using the "processing" email template: 如果您禁用了客户的“保留”电子邮件通知,则可以使用“处理”电子邮件模板,使用以下命令发送有关保留订单状态的电子邮件通知:

add_action('woocommerce_order_status_on-hold', 'email_order_processing_status_for_on_hold', 10, 2 );
function email_order_processing_status_for_on_hold( $order_id, $order ) {
    WC()->mailer()->get_emails()['WC_Email_Customer_Processing_Order']->trigger( $order_id );
}

Code goes in function.php file of your active child theme (or active theme). 代码进入您的活动子主题(或活动主题)的function.php文件中。 Tested and works 经过测试和工作

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 立即将暂停订单设置为在 WooCommerce 中处理并发送处理电子邮件通知 - Immediately set on-hold orders to processing in WooCommerce and send the processing email notification 在Woocommerce中发送具有暂停状态的COD订单的电子邮件通知 - Send email notification for COD orders with on-hold status in Woocommerce 在 Woocommerce 3.3 中下订单后向客户发送暂停订单通知 - Send customer on-hold order notification once order is placed in Woocommerce 3.3 向管理员发送暂停订单状态 email 通知 - Send on-hold order status email notification to admin Woocommerce:将所有新完成的订单保留(特别是COD),并仅发送一封保留电子邮件作为标准确认 - Woocommerce: All new completed orders to on-hold (COD in particular) and send only one on-hold email as a standard confirmation WooCommerce 中的客户将 BACS“搁置”订单限制为仅一个 - Limit BACS "on-hold" orders to only one by customer in WooCommerce 两天后为 WooCommerce 暂停订单发送自定义提醒电子邮件 - Send a custom reminder email for WooCommerce On-Hold orders after two days 在 Woocommerce 中获取客户“暂停”订单状态总金额 - Get customer "on-hold" order status total amount in Woocommerce 发送客户发票 email 与更多收件人 WooCommerce 处理订单 - Send customer invoice email with more recipients for WooCommerce processing orders 使暂停订单状态通知在 Woocommerce 中工作 - Make On-hold order status notification working in Woocommerce
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM