• Hello, I found a way to add the payment instructions to my Woocommerce emails, I also found a way to add text to for example, only the new order email. I tried combining those 2 thing so the payment instructions only will be shown in the new order email, but I did not get it to work yet. Anybody know what to change?

    ———payment instructions in woocommerce email > functions.php ——
    add_action( ‘woocommerce_email_before_order_table’, ‘add_order_email_instructions’, 10, 2 );

    function add_order_email_instructions( $order, $sent_to_admin ) {

    if ( ! $sent_to_admin ) {

    if ( ‘paymentgateway1’ == $order->payment_method ) {
    // note
    echo ‘<p>Instructions: blabla bla blaa blaa blaa</p>’; }

    elseif ( ‘paymentgateway2’ == $order->payment_method ) {
    // note2
    echo ‘<p>Instructions: blabla bla blaa blaa blaa</p>’; }
    else {
    // other methods (ie credit card)
    echo ‘blablabla blaablaa </p>’;
    }
    }
    }

    ———adding text in woocommerce new order email > functions.php ——
    /* add_action(‘woocommerce_email_header’, ‘add_css_to_email’, 20, 2);

    function add_css_to_email($email_heading, $email) {

    // Adds CSS to “new order” email only
    if ( $email->id == ‘customer_processing_order’ ) {

    echo ‘TESTTTTTT’;
    }
    }
    */

The topic ‘payment instructions in email’ is closed to new replies.