• Hello,

    I am using the Additional Custom Emails & Recipients for WooCommerce Pro plugin to create a custom email template in WooCommerce, but it is not being triggered when I call it via PHP. Instead, the default WooCommerce “Completed Order” email is sent.

    This code works correctly and triggers the default WooCommerce “Completed Order” email:

    // Get WooCommerce mailer
    $mailer = WC()->mailer();
    $emails = $mailer->get_emails();

    // Send the default WooCommerce “Completed Order” email
    if (!empty($emails[‘WC_Email_Customer_Completed_Order’])) {
    $emails[‘WC_Email_Customer_Completed_Order’]->trigger($order->get_id());
    $email_log .= “Completed Order Email sent for Order ID: {$order->get_id()}\n”;
    } else {
    $email_log .= “Completed Order Email template not found.\n”;
    }

    However, when I try to trigger my custom email template (alg-wc-custom-email_11), it does not work:

    // Get WooCommerce mailer
    $mailer = WC()->mailer();
    $emails = $mailer->get_emails();

    // Attempt to send the custom email template
    if (!empty($emails[‘alg-wc-custom-email_11’])) {
    $emails[‘alg-wc-custom-email_11’]->trigger($order->get_id());
    $email_log .= “Custom Email sent for Order ID: {$order->get_id()}\n”;
    } else {
    $email_log .= “Custom Email template not found.\n”;
    }

    Could you please help me understand why the custom email template is not being found or triggered? Any guidance would be appreciated.

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Taha Amin

    (@tahaamin)

    Hi @devdmnv,

    Thanks for reaching out! I hope you’re doing well. Apologies for the delayed response.

    I’m sorry to hear about the issue you’re encountering, but I’ll be happy to assist you. As a Pro user, please consider reaching out to us via a support ticket at [email protected] so we can better handle the issue.

    We’ll be waiting for your message there. Thanks for your understanding!

    Plugin Support Taha Amin

    (@tahaamin)

    Hi @devdmnv,

    I believe the issue might be simple. Could you try replacing alg-wc-custom-email_11 with alg_wc_custom_11 and see if that resolves it?

    If the issue persists, please consider reaching out via email.

    Thanks!

    Thread Starter devdmnv

    (@devdmnv)

    @tahaamin I have used ‘alg_wc_custom_11’, but it is not working.

    Plugin Support Taha Amin

    (@tahaamin)

    Hi @devdmnv,

    I’m sorry to hear that. I have received your ticket via our support email, and we will continue communicating through email.

    Regarding the issue, I have reported it to the development team, and they are currently investigating it. I will update you as soon as possible. Apologies for the delay, and thank you for your patience, the issue will be resolved soon.

    Best regards,

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