2017-11-10 14 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

ワンダフル!よく働く。あなたのお手伝いを大変ありがとうございます。 – Lyse

関連する問題