webinfluences

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Use order meta field as trigger #122003
    webinfluences
    Participant

    Hello thanks you for your answer

    I’ve paste it in my function.php

    // Email when invoice yes
    add_action( 'woocommerce_after_order_object_save', function ( $order ) {
    if (
    function_exists( 'alg_wc_ce_send_email' ) &&
    'yes' === $order->get_meta( 'Sage_invoice_File' )
    ) {
    $custom_email_id = 2; // "Custom email #1"
    alg_wc_ce_send_email( $custom_email_id, $order->get_id() );
    }
    } );

    but when i update order,  the email #2 is sent even if  meta “Sage_invoice_File” is “No”

    Do i need to add something else ?

Viewing 1 post (of 1 total)