Php woocommerce-已完成订单电子邮件-don';如果它';定期付款
我使用Subscriptio插件在WooCommerce上运行订阅服务,我不想发送续订订单电子邮件。它们与已完成的订单电子邮件完全相同 我要找的是一个钩子/过滤器,类似于Php woocommerce-已完成订单电子邮件-don';如果它';定期付款,php,wordpress,email,Php,Wordpress,Email,我使用Subscriptio插件在WooCommerce上运行订阅服务,我不想发送续订订单电子邮件。它们与已完成的订单电子邮件完全相同 我要找的是一个钩子/过滤器,类似于woocommerce\u email\u completed\u order,它可以阻止续订电子邮件的发送 我确信这是非常简单的,但这个钩子/过滤器只是逃避了我的谷歌搜索!) 我们想出了办法。您必须在woocommerce\u电子邮件中的woocommerce\u订单状态\u完成\u通知中使用remove\u action()
woocommerce\u email\u completed\u order
,它可以阻止续订电子邮件的发送
我确信这是非常简单的,但这个钩子/过滤器只是逃避了我的谷歌搜索!) 我们想出了办法。您必须在
woocommerce\u电子邮件中的woocommerce\u订单状态\u完成\u通知中使用remove\u action()
对你来说,像这样的事情:
// Conditionally remove action to send email
function unhook_emails($email_class) {
// Check whether to send the renewal email or not
$send_renewal_email = check_send_renewal_email();
if (!$send_renewal_email) {
// Remove action to prevent email from being sent
remove_action(
"woocommerce_order_status_completed_notification",
array(
$email_class->emails["WC_Email_Customer_Completed_Order"],
"trigger"
)
);
}
}
add_action("woocommerce_email", "unhook_emails");
希望这有帮助 我们想出了办法。您必须在woocommerce\u电子邮件中的woocommerce\u订单状态\u完成\u通知中使用remove\u action()
对你来说,像这样的事情:
// Conditionally remove action to send email
function unhook_emails($email_class) {
// Check whether to send the renewal email or not
$send_renewal_email = check_send_renewal_email();
if (!$send_renewal_email) {
// Remove action to prevent email from being sent
remove_action(
"woocommerce_order_status_completed_notification",
array(
$email_class->emails["WC_Email_Customer_Completed_Order"],
"trigger"
)
);
}
}
add_action("woocommerce_email", "unhook_emails");
希望这有帮助 你在使用哪个插件?你需要停止更新电子邮件。我说的对吗?谢谢你的反应!是的,你完全正确!我正在使用Subscriptio插件来扩展WooCommerce。我曾经找到过那个钩子,但我把它丢在了什么地方:(woocommerce\u resend\u order\u emails\u availableAgain,谢谢你,但我需要连接到发送完成的订单电子邮件时触发的东西。然后,我决定订单是否为续订订单,如果是,我将不发送电子邮件。这是我的思路。你使用哪个插件?你需要停止续订电子邮件。我说得对吗?谢谢你的支持。)你的反应!是的,你完全正确!我正在使用Subscriptio插件扩展WooCommerce。我找到了那个钩子,但我把它丢在了某个地方:(woocommerce\u resend\u order\u emails\u availableAgain,谢谢你,但我需要连接一些在发送完成的订单电子邮件时触发的内容。然后,我决定订单是否为续订订单,如果是,我将不发送电子邮件。这是我的思路。