【问题标题】:Send Order Confirmation email notification in WooCommerce thankyou在 WooCommerce 中发送订单确认电子邮件通知谢谢
【发布时间】:2021-05-02 07:14:00
【问题描述】:

我需要通过 php 函数将 Woocommerce 中的订单确认电子邮件发送给店主。 我想将它连接到以下内容:

add_action( 'woocommerce_thankyou', '####', 55 );

但我不知道调用哪个函数来触发电子邮件?电子邮件模板存储在以下目录中,名为:woocommerce/templates/emails/admin-new-order.php 你能帮我解决这个问题吗?

如果您需要更多详细信息,请发表评论! 谢谢!

【问题讨论】:

标签: php wordpress woocommerce orders email-notifications


【解决方案1】:

使用以下内容:

add_action( 'woocommerce_thankyou', function( $order_id){
    WC()->mailer()->get_emails()['WC_Email_New_Order']->trigger( $order_id );
}, 55 );

代码进入活动子主题(或活动主题)的functions.php文件中。

自 WooCommerce 5+ 起: Allow re-sending New Order Notification in WooCommerce 5+

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-01-04
    • 2021-06-12
    • 2020-06-03
    • 2021-10-16
    • 1970-01-01
    • 2019-05-10
    • 1970-01-01
    相关资源
    最近更新 更多