2017-11-10 3 views
1

중인 경우 :
send-an-email-notification-when-order-status-changhe-fron-pendig-to-cancelled사용자 정의 Woocommerce 이메일 통지 순서는 내가이 관련 대답에 내 질문에 대한 부분과 가능한 답을 발견 지불

내가 제공하는 솔루션을 사용하여 생각하고 있지만, 경우보고 싶다 전자 메일 알림을 변경하여 "지불 보류 중 지금 취소됨"이라고 분명하게 말하면 일반 취소 된 주문과 다릅니다.

어떻게하면됩니까?

답변

0

당신은 제목이 이메일의 제목 사용자 정의 할 것이 시도 할 수 :

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(); 

    // Cancelled Order email notification 
    $email_obj = $email_notifications['WC_Email_Cancelled_Order']; 

    // Customizing heading and subject 
    $email_obj->settings['heading'] = __("Pending payment order now Cancelled", "woocommerce"); 
    $email_obj->settings['subject'] = __("[{site_title}] Pending payment order ({order_number}), now Cancelled", "woocommerce"); 

    // Sending the email 
    $email_obj->trigger($order_id); 
} 

코드 활성 자식 테마 (또는 테마)의 function.php 파일에 이동을하거나 또한 어떤 플러그인 파일 .

테스트를 마쳤으며 작동합니다.

+1

Wonderful! 훌륭하게 작동합니다. 모든 도움을 주셔서 대단히 감사합니다. – Lyse