Skip to main content

Overview

WooCommerce includes a comprehensive email notification system that automatically sends emails to customers and store administrators for various order events. The system is highly customizable through hooks, filters, and custom email classes.

Default WooCommerce Emails

WooCommerce sends these emails by default:

Customer Emails

New Order

Sent to customers when a new order is placed.

Processing Order

Sent when order status changes to Processing.

Completed Order

Sent when order status changes to Completed.

Refunded Order

Sent when an order is refunded.

Cancelled Order

Sent when an order is cancelled.

Failed Order

Sent when an order payment fails.

Customer Invoice

Manual invoice email that can be sent by admin.

Customer Note

Sent when a customer note is added to an order.

Reset Password

Password reset email for customer accounts.

New Account

Welcome email when a customer account is created.

Admin Emails

  • New Order: Notifies admin when new order is received
  • Cancelled Order: Notifies admin when order is cancelled
  • Failed Order: Notifies admin when order payment fails

Email Template Structure

WooCommerce email templates follow this hierarchy:

Template Overrides

Override email templates in your theme:
1

Create email directory in your theme

2

Copy template file

Copy the template from WooCommerce to your theme:
3

Customize the template

Edit the template in your theme directory. Your changes will override the default.
Always maintain the same directory structure. Template overrides in incorrect locations won’t work.

Customizing Email Content

Email Heading and Subject

Customize email headings and subjects with filters:

Adding Custom Content

Add content before or after various sections:

Available Email Hooks

Header Hooks:
  • woocommerce_email_header - Before email header
Body Hooks:
  • woocommerce_email_before_order_table - Before order details
  • woocommerce_email_after_order_table - After order details
  • woocommerce_email_order_meta - Order meta section
  • woocommerce_email_customer_details - Customer details section
Footer Hooks:
  • woocommerce_email_footer - Before email footer
Product Hooks:
  • woocommerce_order_item_name - Product name in email
  • woocommerce_order_item_quantity_html - Product quantity display

Styling Emails

Customizing Email Styles

Email styles are defined inline for email client compatibility:

Using Custom Email Template Colors

Set custom colors in WooCommerce settings:

Creating Custom Emails

Create a completely custom email class:
1

Create email class

Create a new class extending WC_Email:
2

Register email class

Add your email to WooCommerce:
3

Create email template

Create templates/emails/custom-email.php in your plugin:
4

Trigger the email

Testing Emails

Send Test Emails

Manually trigger emails for testing:

Email Preview

Add email preview capability:

Email Attachments

Add attachments to emails:

Advanced Customization

Conditional Email Sending

Prevent emails from sending based on conditions:

Custom Email Recipients

Add additional recipients:

Email Settings

Access email settings programmatically:

Troubleshooting

Check WordPress email configuration:
Consider using an SMTP plugin like WP Mail SMTP or Post SMTP.
Ensure CSS is inline (email clients strip <style> tags):

Next Steps

Template Overrides

Learn about template customization

Hooks and Filters

Master WooCommerce hooks