• Resolved CJ Ratliff

    (@aplusmedia)


    I have the admin or store owner emails disabled but would like to programmatically fire the action so that once a function runs using AJAX to finalize an order I can send the email as intended, but only after an AJAX function that is fired on the return of the reciept page after payment.

    The flow is as follows currently:
    Add to Cart -> Cart -> Checkout -> Reciept Page (disabled new order email here) -> Redirect to Payment -> Payment -> Redirect to final Reciept Page (send the disabled new order here).

    I’m trying to use the following to send the disabled new order email:

    // Get the WC_Email_New_Order object
    $email_new_order = WC()->mailer()->get_emails()['WC_Email_New_Order'];
    // Sending the new Order email notification for an $order_id (order ID)
    $email_new_order->trigger( $order->get_id() );

    but the email is never sent, I assume because its disabled under WC > Settings > Email > New Order – but is there a way around this?

    • This topic was modified 6 years, 10 months ago by CJ Ratliff.
    • This topic was modified 6 years, 10 months ago by CJ Ratliff. Reason: Updated title and text
    • This topic was modified 6 years, 10 months ago by CJ Ratliff.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How to fire a disabled WooCommerce New Order notification?’ is closed to new replies.