WC Studio
Academy / Customer Management and Orders

Ultimate Guide to Customizing WooCommerce Email Notifications

1. Introduction

Email remains the most direct line to your customers—confirming orders, updating shipment status, and nurturing repeat business. Out‑of‑the‑box WooCommerce emails work, but they’re generic and hard to distinguish from competitors. Customizing your transactional emails with branded design, targeted content, and dynamic data not only reinforces trust but boosts engagement and opens the door to cross‑sells. In this guide, you’ll learn how to configure, override, and extend every aspect of WooCommerce’s email system—including templates, subjects, styling, attachments, and deliverability best practices—so your messages stand out in 2025’s crowded inbox.

 


 

2. Feature Snippet

Elevate your WooCommerce emails with custom subject lines, branded HTML templates, dynamic placeholders, and personalized content. Override core templates in your theme, inject extra data (customer meta, product recommendations), and attach invoices or packing slips. Leverage MJML or inline CSS for mobile‑responsive design, translate with .po/.mo files, and integrate with SendGrid or Mailgun for reliable delivery and analytics. Build and register new email types for custom order statuses, test previews in staging, and monitor bounces and opens via webhooks. Transform your transactional emails into on‑brand, high‑impact touchpoints.

 


 

3. Why Email Customization Matters: Branding, Engagement & Clarity

  • Brand Consistency: Reinforce your logo, colors, and tone across every touchpoint.

  • Clarity & Trust: Clear subject lines reduce confusion and support tickets.

  • Engagement: Personalized upsell blocks and order summaries drive repeat visits.

  • Conversion Opportunity: Include “You may also like” or loyalty prompts.

  • Deliverability: Proper headers, DKIM/SPF setup, and clean HTML reduce spam placement.

Well‑crafted emails not only confirm transactions but become revenue‑driving assets.

 


 

4. Overview of Default WooCommerce Email Templates

WooCommerce ships with these default templates under woocommerce/templates/emails/:

  • admin-new-order.php

  • customer-processing-order.php

  • customer-completed-order.php

  • customer-invoice.php

  • customer-refunded-order.php

  • customer-on-hold-order.php

  • email-header.php & email-footer.php

  • Plain‑text counterparts (e.g., email-styles.php, *.plain.php)

Templates use a combination of HTML markup and PHP hooks (e.g., do_action('woocommerce_email_before_order_table')) to inject content. Understanding this structure is key to overriding or extending behavior.

 


 

5. Configuring Email Settings (WooCommerce → Settings → Emails)

Navigate to WooCommerce → Settings → Emails to control:

  • Enable/Disable each notification.

  • Recipient(s) for admin emails.

  • Subject line, Email heading, and Additional content fields.

  • Email type (HTML, plain text, multipart).

Save changes and click “Manage” beside each email to adjust defaults. Use clear subject templates like:

CopyInsert

[{{site_title}}] Order #{{order_number}} Confirmed

 


 

6. Overriding Templates in Your Theme

Never edit core plugin files. Instead, copy templates into your theme:

  1. Create folder: your-theme/woocommerce/emails/.

  2. Copy email-header.php, email-footer.php, and any *.php templates you’ll customize.

  3. Modify safely: WooCommerce will load your theme’s versions first.

Example: to add a tracking banner in the footer, edit email-footer.php:

php

CopyInsert

{{ ... existing footer code ... }}

<p style="text-align:center; margin-top:20px;">

  <img src="[https://yourdomain.com/assets/email/tracking-banner.png"](https://yourdomain.com/assets/email/tracking-banner.png") alt="Track Your Order" width="600">

</p>

{{ ... }}

 


 

7. Customizing Subject Lines & Headings via Filters

For dynamic subjects beyond the Settings page, use filters:

php

CopyInsert

// Change customer completed order subject

add_filter('woocommerce_email_subject_customer_completed_order', function($subject, $order) {

  $name     = $order->get_billing_first_name();

  $site     = get_bloginfo('name');

  return sprintf('Thanks %s! Your %s Order #%s Is Complete', $name, $site, $order->get_order_number());

}, 10, 2);

 

// Change new order heading

add_filter('woocommerce_email_heading_new_order', function($heading) {

  return '🚀 New order received – prepare fulfillment!';

});

Use placeholders like {site_title} or custom logic to tailor subjects by customer segment or order size.

 


 

8. Editing Email Content

HTML vs. Plain‑Text Templates

  • HTML templates (*.php) include email-header and email-footer wrappers, inline styling, and rich tables.

  • Plain‑text templates (*.plain.php) strip HTML for simple inboxes.

To add a promotional block in the order email:

php

CopyInsert

// In customer-completed-order.php

{{ ... before order details ... }}

<p style="font-size:16px; color:#333;">

  As a thank you, here’s 10% off your next purchase with code <strong>THANKS10</strong>.

</p>

{{ ... existing order details ... }}

Always preview both versions to ensure readability.

 


 

9. Adding Dynamic Placeholders & Custom Data

Inject extra fields—loyalty points, gift messages, or product recommendations:

php

CopyInsert

// Add custom order meta to emails

add_filter('woocommerce_email_order_meta_fields', function($fields, $order) {

  $fields['loyalty_points'] = [

    'label' => 'Loyalty Points Earned',

    'value' => get_post_meta($order->get_id(), '_loyalty_points', true) ?: '0'

  ];

  return $fields;

}, 10, 2);

 

// Inject recommended products after order table

add_action('woocommerce_email_after_order_table', function($order, $sent_to_admin, $plain_text) {

  if ($plain_text) return;

  echo '<h3>You May Also Like:</h3><ul style="list-style:none; padding:0;">';

  // Fetch 3 cross‑sells

  foreach ($order->get_items() as $item) {

    $product = wc_get_product($item->get_product_id());

    foreach ($product->get_cross_sell_ids() as $id) {

      $p = wc_get_product($id);

      echo sprintf(

        '<li style="display:inline-block; margin:5px; text-align:center;">

           <a href="%s"><img src="%s" width="100"><br>%s</a>

         </li>',

        get_permalink($p->get_id()),

        wp_get_attachment_image_url($p->get_image_id(), 'thumbnail'),

        esc_html($p->get_name())

      );

    }

    break;

  }

  echo '</ul>';

}, 10, 3);

Ensure performance by limiting loops and caching cross‑sells.

 


 

10. Styling Emails

Inline CSS Best Practices

Most email clients strip <style> tags. Use inline styles:

html

CopyInsert

<table width="100%" cellpadding="0" cellspacing="0" role="presentation">

  <tr><td style="padding:20px; background:#f8f8f8; font-family:Arial,sans-serif; color:#333;">

    <!-- content -->

  </td></tr>

</table>

Email Frameworks (MJML, Email Plate)

  • MJML: write lucid, component‑based markup; compile to cross‑client‑compatible HTML.

  • Email Plate: a PHP package to generate responsive emails with templates.

Workflow: author in MJML → compile → paste output into your theme’s *.php templates.

 


 

11. Localization & Translations

Translate email strings via .po/.mo files:

  1. Ensure your theme/plugin text domains are loaded (load_theme_textdomain()).

  2. Copy woocommerce/i18n language files for your locale (e.g., woocommerce-fr_FR.mo).

  3. Override specific strings in your child theme’s languages folder.

For custom placeholders, wrap text in __() or _e():

php

CopyInsert

_e('Order Details', 'your-text-domain');

Use Loco Translate plugin or command‑line tools (wp i18n make-pot).

 


 

12. Attaching Files to Emails

PDF invoices and packing slips add professionalism:

php

CopyInsert

add_filter('woocommerce_email_attachments', function($attachments, $email_id, $order) {

  if ($email_id === 'customer_completed_order') {

    $upload_dir = wp_upload_dir();

    $pdf_path   = $upload_dir['basedir'] . '/invoices/invoice-' . $order->get_id() . '.pdf';

    if (file_exists($pdf_path)) {

      $attachments[] = $pdf_path;

    }

  }

  return $attachments;

}, 10, 3);

Or use plugins like WooCommerce PDF Invoices & Packing Slips to auto‑generate and attach PDFs.

 


 

13. Creating Custom Email Types & Triggers

To send emails for a custom order status (on-fabrication):

  1. Register email class:

  2. php

  3. CopyInsert

add_filter('woocommerce_email_classes', function($emails) {

  require_once 'class-wc-emails-on-fabrication.php';

  $emails['WC_Email_On_Fabrication'] = new WC_Email_On_Fabrication();

  return $emails;

  1. });

  2. Extend WC_Email to define subject, heading, template, and trigger:

  3. php

  4. CopyInsert

class WC_Email_On_Fabrication extends WC_Email {

  public function __construct() {

    $this->id             = 'on_fabrication';

    $this->title          = 'Order on Fabrication';

    $this->customer_email = true;

    $this->template_html  = 'emails/customer-on-fabrication.php';

    parent::__construct();

  }

  public function trigger($order_id) {

    if (!$order_id) return;

    $this->object    = wc_get_order($order_id);

    $this->recipient = $this->object->get_billing_email();

    $this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());

  }

  1. }

  2. Hook into status change:

  3. php

  4. CopyInsert

add_action('woocommerce_order_status_processing_to_on-fabrication', function($order_id) {

  WC()->mailer()->get_emails()['WC_Email_On_Fabrication']->trigger($order_id);

  1. });

Custom emails expand communication for unique workflows.

 


 

14. Conditional Content with Hooks & Filters

Show or hide sections based on order data:

php

CopyInsert

add_action('woocommerce_email_before_order_table', function($order, $sent_to_admin, $plain_text) {

  if ($order->get_total() > 200) {

    echo '<p style="color:green;">You’ve earned free expedited shipping on orders over $200!</p>';

  }

}, 20, 3);

Use customer roles, coupon usage, or product categories to personalize messages.

 


 

15. Testing & Previewing Emails

Admin Previews

Use plugins like Email Preview for WooCommerce to view templates in WP Admin without placing orders.

Logging via wp_mail Filter

Capture email HTML in a log:

php

CopyInsert

add_filter('wp_mail', function($args) {

  error_log(print_r($args, true));

  return $args;

});

Staging Environment

Always test on a staging site with real‑world order data. Confirm both HTML and plain‑text versions render correctly in major clients (Gmail, Outlook, Apple Mail).

 


 

16. Integrating Transactional Email Services

Offload sending and gain analytics:

  • SMTP Plugins: WP Mail SMTP with SendGrid, Mailgun, or Postmark.

  • API‑Based: use official SDKs to send via transactional APIs:

  • php

  • CopyInsert

$mg = Mailgun\Mailgun::create('YOUR_API_KEY');

$mg->messages()->send('mg.yourdomain.com', [

  'from'    => 'Shop <[email protected]>',

  'to'      => $order->get_billing_email(),

  'subject' => $this->get_subject(),

  'html'    => $this->get_content_html(),

  'text'    => $this->get_content_plain()

  • ]);

  • Bounce & Complaint Hooks: configure webhooks to track deliverability issues.

Transactional services ensure large volumes don’t suffer throttle limits or blacklisting.

 


 

17. Monitoring Deliverability & Analytics

Track key metrics:

  • Bounces & Complaints: auto‑remove or suppress 이메일 on bounce.

  • Opens & Clicks: embed tracking pixels or link parameters.

  • Reporting Dashboards: review stats in SendGrid/Mailgun and tie back to order performance.

Use webhooks to log events in your database or Slack for real‑time alerts on failed deliveries.

 


 

18. Accessibility & Mobile‑Responsive Design

Ensure emails render for all users:

  • Semantic HTML: use proper headings (<h1>, <h2>), tables with role="presentation".

  • Alt Text: provide alt for images.

  • Contrast & Font Size: meet WCAG AA standards (4.5:1 contrast, ≥14px body text).

  • Media Queries: stack columns, enlarge buttons on small screens.

Test with tools like Litmus or Email on Acid for broad client coverage.

 


 

19. Frequently Asked Questions

Q1: How do I reset email template overrides after updates?
Compare your theme’s woocommerce/emails folder with the latest plugin templates and merge changes. Use Git to track diffs and avoid drift.

Q2: Can I send marketing content in transactional emails?
Keep marketing minimal and strictly secondary—regulations like GDPR and CAN-SPAM require clear transactional vs. promotional separation.

Q3: How do I add a dynamic order countdown timer?
Use a service like MotionMail or embed a GIF countdown:

html

CopyInsert

<img src="[https://motionmailapp.com/envato/countdown/xxxx.gif"](https://motionmailapp.com/envato/countdown/xxxx.gif") alt="Sale ends in 24h">

 


 

20. Conclusion

Customizing WooCommerce email notifications transforms routine order messages into powerful engagement and branding tools. Start by configuring subjects and headings in Settings, then override core templates in your theme to apply branded HTML and inline CSS. Leverage filters and actions to inject dynamic data—loyalty points, recommendations, or conditional upsells—while ensuring localization and accessibility. Attach invoices or packing slips via the attachments filter, and build custom email types for unique workflows. Test thoroughly in staging and preview tools, integrate with SendGrid or Mailgun for scalable, monitored delivery, and track opens, bounces, and clicks to optimize performance. By adhering to these practices in 2025, your WooCommerce emails will delight customers, reinforce trust, and drive incremental revenue every time an order is placed.