• We’re seeing duplicate admin “New order” emails on instant payments (Paytrail/Klarna).
    Trace shows two separate plugin triggers after payment:

    • PLLWC_Emails->send_new_order_email → calls WC_Email_New_Order->trigger (Polylang)
    • Brightplugins_COS\Checkout->admin_new_order_email → calls WC_Email_New_Order->trigger on woocommerce_payment_complete (Custom Order Status Manager)
      WooCommerce also sends on pending → processing, so these extra triggers duplicate the notification.

    Could you either:

    1. avoid manual triggering when Woo core will send, or
    2. gate your trigger with an idempotency check (e.g., _admin_new_order_sent meta), or
    3. provide a setting/filter to disable your extra send in instant-payment flows?

    Example guard (pseudo):
    add_action('woocommerce_payment_complete', function($order_id){
    $order = wc_get_order($order_id);
    if (!$order || $order->get_meta('_admin_new_order_sent')) return;
    $email = WC()->mailer()->emails['WC_Email_New_Order'] ?? null;
    if (!$email || !$email->is_enabled()) return;
    // Optionally: only trigger if core won't (e.g., no status transition occurred)
    $email->trigger($order_id);
    $order->update_meta_data('_admin_new_order_sent', time());
    $order->save();
    });

    Thank you for the plugin!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter olppa

    (@olppa)

    Polylang’s support answered:

    You are right, Brightplugins_COS and Polylang send this email twice.
    It requires to develop a compatibility. It is the first time we have encountered an issue with this plugin. As of today, we don’t plan a compatibility.
    Would you please contact the development Brightplugins Custom Order Status Manager team? Maybe they already encountered this feedback and have a workaround.

    If Brightplugins has any questions about Polylang, feel free to tell them to contact us. We will provide Polylang license and guide them in our code.

    Plugin Support mathdaniel

    (@mathdaniel)

    Hello,

    I hope you are doing well.

    Thank you for the report and for the tests conducted. We have forwarded the case to the appropriate team for their internal review, and we will keep track from this thread, sharing any updates or solutions here.

    We appreciate your participation.

    Best regards,peace!

    • This reply was modified 4 months, 1 week ago by threadi.
    • This reply was modified 4 months, 1 week ago by mathdaniel.
    Thread Starter olppa

    (@olppa)

    Hi @mathdaniel

    I tried disabling the COS plugin and the duplicate emails went away.
    I’ve narrowed down the issue to Checkout.php.

    Your duplicates were caused by Checkout::admin_new_order_email triggering WC_Email_New_Order on woocommerce_payment_complete, on top of WooCommerce’s own email on status change. Please either:

    • remove that trigger by default,
    • gate it to offline methods only, and/or
    • add an idempotency guard (order meta) so it can’t send twice.
    Plugin Support mathdaniel

    (@mathdaniel)

    Hello @olppa,

    I hope you are well.
    As I had mentioned, this was referred to the team in charge, which works through organized sprints to address the needs of all users.
    Thanks once again for your participation; what you have shared has been taken into account for analysis.

    Best regards, peace!

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.