Created
October 3, 2017 13:37
-
-
Save lukecav/ad513636b166ba54c03e34d2323f52b5 to your computer and use it in GitHub Desktop.
Send an email notification when order status change from pending to cancelled in WooCommerce
This file contains hidden or 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
| add_action('woocommerce_order_status_pending_to_cancelled', 'cancelled_send_an_email_notification', 10, 2 ); | |
| function cancelled_send_an_email_notification( $order_id, $order ){ | |
| // Getting all WC_emails objects | |
| $email_notifications = WC()->mailer()->get_emails(); | |
| // Sending the email | |
| $email_notifications['WC_Email_Cancelled_Order']->trigger( $order_id ); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/45732404/send-an-email-notification-when-order-status-change-from-pending-to-cancelled