How to force Failed mail sending for admin?
-
Hello. I don’t know why, but my website stopped sending Failed Order emails for admin. I tried to make a code, which can send this mail, but it still won’t send. Maybe anyone can help me? Maybe it is something bad in my code?
Code:
add_action('woocommerce_admin_failed_order_changed', 'admin_failed_order_email_notifications', 10, 4 ); function admin_failed_order_email_notifications( $order_id, $old_status, $new_status, $order ){ // Only when order status is changed to 'cancelled' if ( $new_status != 'failed' ) return; // Send cancelled email notification WC()->mailer()->get_emails()['WC_Email_Failed_Order']->trigger( $order_id ); }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to force Failed mail sending for admin?’ is closed to new replies.