복붙노트

[WORDPRESS] 주문이 만료 될 때 WooCommerce 취소 이메일 알림 메시지가 전송되지 않음

WORDPRESS

주문이 만료 될 때 WooCommerce 취소 이메일 알림 메시지가 전송되지 않음

해결법


  1. 1.강제로 다음을 시도해 볼 수도 있습니다, 이메일 알림을 보내도록 "취소"

    강제로 다음을 시도해 볼 수도 있습니다, 이메일 알림을 보내도록 "취소"

    add_action('woocommerce_order_status_changed', 'cancelled_order_email_notifications', 10, 4 );
    function cancelled_order_email_notifications( $order_id, $old_status, $new_status, $order ){
        // Only when order status is changed to 'cancelled'
        if ( $new_status != 'cancelled' ) return;
    
        // Send cancelled email notification
        WC()->mailer()->get_emails()['WC_Email_Cancelled_Order']->trigger( $order_id ); 
    }
    

    코드는 function.php의 활성 자식 테마의 파일 (또는 활성 테마)에 간다.

    테스트 및 작동합니다.

  2. from https://stackoverflow.com/questions/48181814/woocommerce-cancelled-email-notification-not-sent-when-order-expires by cc-by-sa and MIT license