Created
May 25, 2019 12:28
-
-
Save nczz/2dd495d4b931fe4426de513ac356899e to your computer and use it in GitHub Desktop.
[WooCommerce] 程式化觸發訂單狀態發信機制
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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