Customizing emails in WooCommerce can be tricky if you rely only on order status. A better approach is to target a WooCommerce email notification by email ID, which gives you precise control over each email type.
In this guide, you’ll learn how to use $email->id to customize WooCommerce emails efficiently with practical examples.
What is WooCommerce Email ID?
A WooCommerce email ID is a unique identifier assigned to each email notification.
Common Email IDs
new_ordercancelled_orderfailed_ordercustomer_processing_ordercustomer_completed_order
These IDs help you directly target a WooCommerce email notification by email ID instead of relying on indirect conditions.
How to Target WooCommerce Email Notification by Email ID
🎯 Example Code
add_action('woocommerce_email_before_order_table', 'custom_email_logic', 10, 4);function custom_email_logic($order, $sent_to_admin, $plain_text, $email) {
if ($email->id === 'new_order') {
echo '<p>This content appears only in New Order emails.</p>';
}}Default WooCommerce Email Settings
Go to: 👉 WooCommerce → Settings → Emails
Here you can:
- Enable/disable email types
- Change email subject & content
- Add recipient email IDs
How to Add Multiple Email IDs in WooCommerce
Simple Method (No Coding)
You can add multiple email addresses like this:
admin@example.com, manager@example.com, warehouse@example.com👉 Works for:
- New order emails
- Cancelled orders
- Failed orders
Advanced WooCommerce Email Customization Using Code
If you want full control, use WooCommerce hooks.
Example: Add Custom Email Recipient
add_filter('woocommerce_email_recipient_new_order', 'add_multiple_recipients', 10, 2);function add_multiple_recipients($recipient, $order) {
$recipient .= ', warehouse@example.com';
return $recipient;
}👉 This allows dynamic email control.
Real-World Use Cases
1. Notify Warehouse Team Only for Physical Orders
add_filter('woocommerce_email_recipient_new_order', 'warehouse_email', 10, 2);function warehouse_email($recipient, $order) {
if ($order->needs_shipping_address()) {
$recipient .= ', warehouse@example.com';
}
return $recipient;
}2. Notify Manager for High-Value Orders
add_filter('woocommerce_email_recipient_new_order', 'high_value_order_email', 10, 2);function high_value_order_email($recipient, $order) {
if ($order->get_total() > 10000) {
$recipient .= ', manager@example.com';
}
return $recipient;
}3. Send Emails Based on Product Category
👉 Example:
- Electronics → Tech Team
- Clothing → Inventory Team
Customize WooCommerce Email Content
You can also improve email design.
Steps:
- Go to WooCommerce → Emails
- Customize:
- Header image
- Footer text
- Colors
Advanced (Template Override)
Copy files from:
/wp-content/plugins/woocommerce/templates/emails/
To:
your-theme/woocommerce/emails/
Then customize:
- Layout
- HTML
- Content
❓ FAQs
1.What is WooCommerce email ID?
A unique identifier used to target specific email notifications.
2.Why use email ID instead of order status?
It provides more accurate and reliable email customization.
3.Can I customize WooCommerce emails without plugins?
Yes, using hooks and $email->id in code.
4.Is this method beginner-friendly?
Yes, with basic PHP knowledge.






