Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wp_user1

    (@wp_user1)

    Hey there WooCommerce experts,
    I am trying now for hours, but no idea what’s wrong.

    I simply want to send the WC_Email_New_Order mail manually via source code. I am using this code:

    $post_id=346;
    $order = wc_get_order( $post_id );
    $mailer = WC()->mailer();
    $email = $mailer->emails['WC_Email_New_Order'];
    $email->trigger( $order->get_id(), $order );

    Nothing happens.
    When using the same code for WC_Email_New_Order everything works fine:

    $post_id = 346; // Order ID
    $order = wc_get_order($post_id);
    $mailer = WC()->mailer();
    $email = $mailer->emails['WC_Email_Customer_Completed_Order'];
    $email->trigger($order->get_id(), $order);

    Also when sending WC_Email_New_Order again via order details in WordPress backend. So mail configuration, template and recipient are okay.
    Any ideas what could be wrong here? ??

    Plugin Support EastOfWest a11n

    (@eastofwest)

    Hi @wp_user1, thanks for the review – I’m glad to hear it’s all working perfectly!

    For your support request, please open a support thread in the forums, then we’ll help you there. Add details about what you’re trying to do exactly and where you’re trying to do it from (e.g. WP Admin, functions.php, etc.) so that the context is clearer. Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this review.