Share X in ✉

How to Set Up a WooCommerce Order Confirmation Email

Last updated
Read time
9 min
Category
How to Set Up a WooCommerce Order Confirmation Email

To set up a WooCommerce order confirmation email, enable the Processing order email under WooCommerce → Settings → Emails, then customize its header, footer, and content using WooCommerce’s built-in email settings, template overrides, PHP hooks, or a visual email builder like YayMail. WooCommerce uses a hierarchy of templates, such as email-header.php, email-footer.php, and order-specific files, so you can change layout and content at whichever level fits what you need.

This guide covers enabling the email, customizing it through four different methods, triggering it programmatically, attaching an invoice, and fixing delivery problems.

WooCommerce Email Types

WooCommerce sends two kinds of email: marketing emails, which are optional promotional messages like abandoned cart reminders or discount offers, and transactional emails, which are triggered automatically by order and account activity. The order confirmation email is a transactional email.

Go to WooCommerce → Settings → Emails to see the full list.

WooCommerce ships with 10 transactional emails by default, or 13 if you run a WooCommerce membership site:

  • New order: sent to you and the customer when a new order is placed.
  • Order on hold: sent to the customer when an order is placed on hold.
  • Processing order: sent to the customer after payment completes. This is the order confirmation email.
  • Completed order: sent when you mark the order as shipped or complete.
  • Cancelled order: sent if an order is cancelled.
  • Failed order: sent when an order fails.
  • Refunded order: sent when a refund is processed.
  • Customer note: sent when you add a note to the order in the admin panel.
  • New account: sent when a customer creates a new account.
  • Reset password: sent when a customer requests a password reset.

How to Send the Order Confirmation Email in WooCommerce

The order confirmation email is the message customers receive right after completing an order. Here’s how to enable it.

  1. Go to WooCommerce → Settings → Emails.
  2. Click Manage next to Processing order.
  3. Toggle Enable/Disable to turn it on.
  4. Optionally edit the header, title, and additional content, such as a thank-you note. Here’s how it can look in the customer’s inbox.

Modifying the Template with Code

To edit the template directly, click Copy file to theme, then View template.

You’ll need PHP knowledge to make changes safely here. The edit screen shows the template file’s location on your server, and you can create your own PHP template file to replace it.

Each transactional email is built from a set of template files. To change only the header, edit email-header.php. To change the footer, edit email-footer.php. To change the invoice email specifically, edit customer-invoice.php.

For example, to change link color in the email, open wp-content/plugins/woocommerce/templates/emails/email-styles.php, find the link class, and replace it:

.link {
    color: #279100;
}

Customizing with Hooks

Hooks let you add content to the order confirmation email without editing existing template files. Add these snippets to your child theme’s functions.php.

To add a note below the header, use woocommerce_email_header:

<?php
add_action( 'woocommerce_email_header', 'mm_email_header', 10, 2 );
function mm_email_header( $email_heading, $email ) {
    echo '<p>Thanks so much for your order! We appreciate you and hope you enjoy your new items.</p>';
}

To add content after the order details table, use woocommerce_email_after_order_table:

<?php
add_action( 'woocommerce_email_after_order_table', 'mm_email_after_order_table', 10, 4 );
function mm_email_after_order_table( $order, $sent_to_admin, $plain_text, $email ) {
    echo '<p>Here is a coupon code for your next purchase: 20OFF</p>';
}

To add content above the footer, use woocommerce_email_footer:

<?php
add_action( 'woocommerce_email_footer', 'mm_email_footer', 10, 1 );
function mm_email_footer( $email ) {
    ?>
    <p><?php printf( __( 'Thank you for choosing us. Here is our special sale collection: %s', 'woocommerce' ), '<a href="' . get_permalink( wc_get_page_id( 'shop' ) ) . '">' . __( 'Shop', 'woocommerce' ) . '</a>' ); ?></p>
    <?php
}

Triggering the Email Programmatically

If you need to send the order confirmation email from your own code, rather than waiting for WooCommerce’s normal order-status trigger, you can call the email class directly:

<?php
function wa_send_processing_order_email( $order_id ) {
    $order = wc_get_order( $order_id );
    if ( ! $order ) {
        return;
    }

    $mailer = WC()->mailer();
    $email  = $mailer->get_emails()['WC_Email_Customer_Processing_Order'];

    if ( $email ) {
        $email->trigger( $order_id );
    }
}

Call wa_send_processing_order_email( $order_id ) from wherever your custom logic determines the email should go out, for example a custom order status change or an integration with another system. 

This uses WooCommerce’s own WC_Emails class, so the email respects your existing template and settings rather than sending a separate hardcoded message. Swap WC_Email_Customer_Processing_Order for another class, such as WC_Email_Customer_Completed_Order, to trigger a different transactional email the same way.

Built-In Template Customization

WooCommerce includes basic customization options that apply to all email templates. Under the Emails tab, scroll down to the shared template settings.

Click “Click here to preview your email template” to see the current design.

You can upload a header image by hosting it anywhere and pasting the URL into the Header image field, add a footer note or policy links in Footer text, and change colors by clicking any color code to open the color picker.

Here’s how the result can look.

These built-in options apply to every email template at once and are limited. For more control over the order confirmation email specifically, use a dedicated plugin.

Customizing with YayMail

YayMail is a free drag-and-drop email customizer for WooCommerce, with a Pro version and paid add-ons for extending compatibility with other WooCommerce extensions.

Install it from Plugins → Add New, then go to WooCommerce → Email Customizer.

From the top dropdown, select Processing order and choose an existing order to preview against.

Click any element, such as the logo, to edit it. You can upload your own logo, resize and align it, and add a link.

Click the header to edit its background and text color, then scroll to the text editor to insert images, tables, links, and shortcodes.

Customizing the email body

The order item section lists products, quantities, prices, and totals. Under Settings → General, you can toggle:

  • Show product image
  • Show product SKU
  • Show product description
  • Show product hyperlinks
  • Custom CSS

Enabling product images adds options for image height, width, resolution, and alignment.

You can also edit font size, color, and text in the address section.

Elements available in the editor

The left panel has three tabs: Basic (logo, images, video, text, buttons, footer, social icons, custom HTML), General (spacing and columns), and WooCommerce (order-related elements for building a template from scratch).

For a product recommendation section, drag a title element and an image list element (three image slots) from Basic, then add a three-column element from General with a button in each column. Adjust padding, radius, button text, and alignment.

Customizing the footer

Add a title section, a two-column section for app links or images, and a social icon element. Include links to your refund policy, terms and conditions, and an unsubscribe link, plus your contact details.

The finished template can look like this.

Attaching an Invoice with Challan

Invoices matter for your records, tax reporting, and customer trust, but WooCommerce doesn’t generate them natively. Challan is a WordPress.org plugin that automatically creates PDF invoices, packing slips, shipping labels, and credit notes, and attaches the invoice to the order confirmation email.

challan-free

You can design a custom invoice template using Challan’s settings, choose from pre-made layouts, add a background image and custom fields, and customize the template further with CSS. Options include payment methods, QR codes, barcodes, signatures, and paid stamps.

Key features:

  • Automatic invoice generation attached to the order confirmation email.
  • Multiple pre-made invoice templates.
  • Custom fields, barcodes, QR codes, and tax information.
  • Brand elements: logo, custom footer, links, signature, paid stamps.
  • Bulk document downloads.
  • Extensive CSS customization.
  • HPOS (High-Performance Order Storage) compatibility.

Pricing: A free version is available in the WordPress plugin repository. The Pro version starts at $29 per year for a single site, with additional tiers for more sites and lifetime purchase options. Check the current pricing page for exact tiers before publishing, since plans are periodically adjusted.

To attach an invoice:

  1. Install Challan from Plugins → Add New.
  2. Create a test order under WooCommerce → Orders → Add new.
  3. Set the order status to Processing and enter demo billing details.
  4. Click Add items → Add products to add products to the order.
  5. Click Create. Challan generates the invoice and attaches it to the confirmation email automatically.

If Customers Aren’t Receiving the Email

By default, WordPress sends transactional email through PHP’s mail() function directly from your hosting server. Many hosting environments aren’t configured to authenticate outgoing mail properly, and providers like Gmail and Yahoo increasingly reject or spam-folder unauthenticated messages. If your customers aren’t getting the order confirmation email, the mail was likely never delivered rather than lost after sending.

Steps to diagnose and fix it:

  1. Check the customer’s spam or junk folder first, and confirm the email address on the order is correct.
  2. Install a free logging plugin like WP Mail Logging to confirm whether WordPress actually attempted to send the email. This tool only records send attempts; it doesn’t improve deliverability on its own.
  3. If WordPress isn’t sending the mail reliably, or sent mail is landing in spam, install an SMTP plugin, such as WP Mail SMTP, FluentSMTP, or Post SMTP, and connect it to an authenticated provider like Google Workspace, Amazon SES, Brevo, or SendGrid. This is the step that actually fixes deliverability, since it replaces PHP’s unauthenticated mail() function with a properly signed, authenticated send.
  4. Check WooCommerce → Status → Logs for email-related errors if your version of WooCommerce logs them.

Frequently Asked Questions

How do I send the order confirmation email in WooCommerce?

Go to WooCommerce → Settings → Emails, click Manage next to Processing order, and toggle Enable/Disable on. WooCommerce then sends it automatically once a customer’s payment is confirmed.

Why isn’t WooCommerce sending order confirmation emails?

This is usually a mail delivery problem, not a WooCommerce setting. Shared hosting often lacks proper email authentication, causing messages to be rejected or marked as spam. Installing an SMTP plugin connected to an authenticated email provider is the most reliable fix.

Can I trigger a WooCommerce order confirmation email programmatically?

Yes. Use WC()->mailer()->get_emails()[‘WC_Email_Customer_Processing_Order’]->trigger( $order_id ) from your own PHP code. This sends the email using your existing template and settings rather than building a separate custom message.

How do I customize the WooCommerce order confirmation email without coding?

Use the built-in template settings under WooCommerce → Settings → Emails for basic header image, footer text, and color changes, or install a plugin like YayMail for full drag-and-drop control over layout, content, and product display.

Can I attach an invoice to the WooCommerce order confirmation email?

Yes. A plugin like Challan generates a PDF invoice automatically when an order is placed and attaches it to the confirmation email, without any manual steps per order.

Where can I find the WooCommerce order confirmation email template files?

Template files live in wp-content/plugins/woocommerce/templates/emails/. The processing order email specifically uses customer-processing-order.php, alongside shared files like email-header.php and email-footer.php.

Can I send different confirmation emails for different products?

WooCommerce’s core email system doesn’t support per-product email variants natively. This typically requires custom code using conditional logic inside the relevant email hook, checking the order’s line items and only adding certain content when a specific product is present.

Is customizing the order confirmation email safe to do without breaking other emails?

Editing a shared template file, like email-header.php, affects all emails using that file. Using hooks or a plugin like YayMail is safer for changes meant to apply to the order confirmation email specifically, since they target that email individually.

Key Takeaways

  • The order confirmation email is WooCommerce’s Processing order email, enabled under WooCommerce → Settings → Emails.
  • You can customize it four ways: built-in settings, direct template edits, PHP hooks, or a plugin like YayMail, in increasing order of flexibility.
  • To trigger the email programmatically from custom code, call WC()->mailer()->get_emails()[‘WC_Email_Customer_Processing_Order’]->trigger( $order_id ).
  • Challan can automatically attach a PDF invoice to the confirmation email with no manual steps per order.
  • Most “not receiving emails” problems are deliverability issues caused by unauthenticated PHP mail, not a WooCommerce setting, and are fixed with an SMTP plugin connected to an authenticated provider.
[CTA] Stop reading. Start fixing.
Fix your product feed with CTX Feed Pro.

Free version on WordPress.org. Every Pro licence includes a 30-day money-back guarantee.

[0] Comments
Join the discussion
Leave a comment →

Leave a comment.

[NEWSLETTER] Field Notes, monthly

One email a month.
Zero fluff.

Channel-spec changes, plugin releases, the occasional deep dive on something we broke.