Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WooCommerce] 程式化觸發訂單狀態發信機制
<?php
function mxp_woo_cao_cancel_order_event($order_id){
$mailer = WC()->mailer();
$mails = $mailer->get_emails();
if ( ! empty( $mails ) ) {
foreach ( $mails as $mail ) {
if ( $mail->id == 'cancelled_order' ) {
$mail->trigger( $order_id );
}
}
}
}
add_action('woo_cao_cancel_order','mxp_woo_cao_cancel_order_event',11,1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.