in operationWooCommerceWhen it comes to stores, the automated email feature can save a lot of things and help to easily receive and send customer inquiries/messages, operations that can sometimes require a lot of effort.
The system automatically sends these default emails when a specific event occurs (e.g. an automatic email reminder when a customer has placed an order but has not yet paid). For example: order processing, refund processing orPassword resetetc. When using WooCommerce, these operations are made easier by having features dedicated to email automation and customer handling.
This article will cover why you need to customize your WooCommerce emails and how to do it simply.
![图片[1]-如何自定义 WooCommerce 邮件 | 提升店铺邮件效果与顾客互动](https://www.361sale.com/wp-content/uploads/2024/12/20241212143539973-image.png)
Why should I customize my emails?
Emails are an integral part of a WooCommerce store. Multiple studies have shown that personalized emails boost user engagement and revenue. It also increases the open, click and response rates of emails. In addition, personalized emails don't make customers feel like they're receiving spam.
Customizing WooCommerce emails helps build trust in the minds of your customers, making them more likely to interact with your online store from time to time. When customizing your emails, you need to take into account the brand style, colors, tone, and format, in addition to focusing on the personalization of your emails. Here are a few pointers to consider while customizing your WooCommerce emails:
- Recipient's name
- subject line
- transmission time
- Relevance of email content
- Order Information
WooCommerce Order Status Types
WooCommerce includes multiple order statuses that may not exactly match the flow of the site. However, it is still possible to mark an order with a customized status, such as "Pending Payment", "Processing", "Suspended", "Failed ", etc.
Many WooCommerce webmasters have questions about how to customize the default WooCommerce request information to present a personalized look and feel? How to add additional content to help customers process orders and create custom WooCommerce order statuses?
For the uninitiated, WooCommerce offers a wide range of options, and non-professionals can create some fantastic emails.
![图片[2]-如何自定义 WooCommerce 邮件 | 提升店铺邮件效果与顾客互动](https://www.361sale.com/wp-content/uploads/2024/12/20241212143634657-image.png)
WooCommerce Default Transaction Email Types (with code)
"Vanilla" provides WooCommerce email notifications that are sent to customers as they interact with the store. Here are the most important emails for WooCommerce store customers.
- New Orders:A new order email is sent when a new order is received.
- Canceled orders:A canceled order email is sent when an order is marked as canceled.
- Failed orders:Failed order emails are sent when an order that is being processed or suspended is marked as failed.
- Orders are suspended:This is an order notification sent to the customer. It contains details of the order after the order has been suspended.
- Processing orders:This is an order notification sent to the customer. It contains details of the order after payment has been made.
- The order has been completed:When an order is completed, the system sends an order completion email to the customer. These emails usually indicate that the order has been shipped.
- Refund Orders:When a customer's order is marked for refund, an order refund email will be sent to the customer.
- Customer invoices:Customer invoice emails contain order information and payment links.
- Customer Remarks:When a note is added to an order, a customer note email is sent.
- Reset password:When a customer resets their password, a customer "reset password" email is sent.
- New account:When a customer registers through the checkout or account registration page, a "new account" email is sent to the customer.
In addition to these standard email types, custom emails can be added.
WooCommerce Global Email Options
The standard WooCommerce email is shown below:
![图片[3]-如何自定义 WooCommerce 邮件 | 提升店铺邮件效果与顾客互动](https://www.361sale.com/wp-content/uploads/2024/12/20241212115525858-image.png)
WooCommerce administrators can make some basic customizations to this default email layout. Log in to your WordPress administrator and go toWooCommerce → Settings → Email → Email Sender OptionsAfterward, these options can be accessed. These options include:
- Set sender name/address (visible to customers)
- WooCommerce Email Header Image Size
- Changing e-mail footer text
- Choose different base, background and body colors

WooCommerce Email Specific Options
Each email type has its own set of customization options. The customization options can be accessed through theWooCommerce → Settings → Email → Processing OrdersAccess these options (this sample path focuses on processing order emails). Several aspects of the email can be changed, including:
- Enable or disable whether to send e-mail
- Subject of the e-mail
- Email header (default is "Thank you for your subscription")
- Whether the e-mail is sent as HTML or plain text (the default option is HTML)

I set the custom email title here to "Thank you for your order."
How to Customize WooCommerce Email Templates
A more effective and efficient method is to modify the default email layout.WooCommerce provides a useful template system to customize parts of a store or email by copying formatting files into the theme.
Each email type has a template file used to describe its content.
Example:
woocommerce/templates/emails/customer-process-order.php.
There are also shared templates that can be accessed and used by all email types. These templates can be found in the woocommerce/templates/emails/email-styles.phpFind.
In many cases, this is the template that developers override to change the sharing aspect of an email. The process for dealing with the footer issue mentioned earlier is:
- First, make sure the following directory exists in your WordPress installation:wp-content/themes/ your-theme /woocommerce/emails.
- Next, put wp-content/plugins/woocommerce/templates/emails/email-styles.phpCopy the files in the Store Theme to the Store Theme:your-theme /woocommerce/emails/The
- Finally, the editorthematic/woocommerce/emails/email-styles.phpChange the color of the footer text to black (for simplicity, only the relevant portion of the template file code will be displayed):
$credit = "
color: #66bae3.
font-size:15px;
text-align:center;
";;
This will generate a more readable footer:
Condition customization using operations/filters
The ultimate and most efficient way to customize your email is to use WooCommerce custom code. This obviously requires a high level of PHP expertise. The good news is that the process is simple because the original WooCommerce layout is still in use. The process involves changing some of the content.
filter function
- has_filter()
- Add Filter ()
- apply_filters()
- apply_filters_ref_array()
- Current Filter ( )
- Remove Filter ()
- Delete all filters ()
- doing_filter()
action function
- has_action()
- Add Action ()
- Execute Action()
- Perform operation_ref_array()
- did_action()
- Delete operation ( )
- Delete All Operations()
- Execute action ( )
Activate/deactivate/uninstall functions
For this example, I'll add some helpful payment instructions to the email based on the type of checkout payment used.
First, add the following to the theme'sfunctions.phpCenter:
add_action( 'woocommerce_before_email_order', 'add_order_instruction_email', 10, 2 );
function add_order_instruction_email( $order, $sent_to_admin ) {
if ( ! $sent_to_admin ) {
if ( 'cod' == $order->payment_method ) {
// cash on delivery method
echo '<p><strong>Instructions.</strong> Full payment is due immediately upon delivery. <em>cash only, no exceptions</em>.</p>'; } else {
} else {
// other methods (ie credit card)
echo '<p><strong>Instructions.</strong> Please look for "Madrigal Electromotive GmbH" on your next credit card statement.</p>';
}
}
}
If the customer selects "Cash on Delivery" at checkout, the customer will receive an email with helpful order instructions:
![图片[6]-如何自定义 WooCommerce 邮件 | 提升店铺邮件效果与顾客互动](https://www.361sale.com/wp-content/uploads/2024/12/20241212120513209-image.png)
Plug-in/Payment Gateway Options
Some plugins and payment gateways can actually customize parts of the order email. For example, the built-in bank/wire transfer payment method can be configured with instructions and wire transfer information inserted.
This can be done via WooCommerce > Settings > Checkout > BACSDone .
![图片[7]-如何自定义 WooCommerce 邮件 | 提升店铺邮件效果与顾客互动](https://www.361sale.com/wp-content/uploads/2024/12/20241212120543194-image.png)
It's not common, but it's nice to know that these options are available. This information also allows for the selection of specific plugins for the store.
WooCommerce Email add_actions Hooks
The add_actions hook often comes in handy when working with WooCommerce emails. To use this hook, you need to use the global variable email, which contains the email subject. Below is the code snippet:
add_action( 'woocommerce_email_header', 'woocommerce_emails_before_header', 1,3 );
function woocommerce_emails_before_header( $email_heading, $email ){
$GLOBALS['email'] = $email;
}
The above hooks can be placed in functions.php (located in the theme folder) or at the beginning of the WooCommerce email template. The global variable $email calls the main WooCommerce email object, while $order contains an instance of the global WooCommerce order object.
global $email;
$order = $email->object;
WooCommerce Customized Emails per Product
The following code sends customized order email templates for different products. For example, forProduct ID 87If you want to display header WooCommerce email notifications or how to test WooCommerce emails:
function woocommerce_custom_email_per_product_depending_on_product_id( $email_heading, $order ) {
global $woocommerce;
$items = $order->get_items();
foreach ( $items as $item ) {
$product_id = $item['product_id'];
if ( $product_id == 87 ) {
$email_heading = 'WooCommerce email notification OR how to test WooCommerce emails';
}
return $email_heading;
}
}
add_filter( 'woocommerce_email_heading_customer_processing_order', 'woocommerce_custom_email_per_product_depending_on_product_id', 10, 5 );
Now that you know the entire process of customizing your WooCommerce order emails, you can either keep the feature or create a separate WooCommerce email plugin for WooCommerce email confirmations and notifications.
How to Customize WooCommerce Emails Using Plugins
There are various plugins available for customizing WooCommerce emails, our choice here is the MailPoet extension.
First, install the MailPoet extension from the WordPress dashboard, following the same steps as any other plugin. Then, follow these simple steps:
- Navigate to MailPoet → Settings → WooCommerce in the WordPress dashboard. select "Customizing WooCommerce Emails with MailPoet" and save the settings.
- Click "Open the template editor".

- Make changes using MailPoet's drag-and-drop editor.

- It is easy to experiment with the areas above and below the email header and main content areas. Some of the adjustments that can be made include:
- Putting the website logo at the top
- Colors that match your website's branding
- Add an image or button to add some flair
- Insert social media links

MailPoet can also categorize audiences based on specific details, helping to customize communications for different groups. Individuals can be categorized based on the following:
- How often they open e-mail
- spend
- Purchased goods
- point
- Active Subscription Status
- Clicking on certain links
- Enrollment Date
How to Edit WooCommerce Transaction Emails
Customizing transactional emails in WooCommerce is essential to creating a personalized and engaging communication channel with your customers. By customizing these emails to match your brand image and customer expectations, you can enhance the overall shopping experience.
Below are the steps to customize transactional emails in WooCommerce:
1. Access e-mail settings:
- Log in to the WordPress dashboard.
- In the left menu, click WooCommerce → SettingsThe

2. Navigate to the e-mail template:
- In the top menu, find and click "email" to access the template.
3. Explore e-mail templates:
- A list of email templates will be seen, each with a specific purpose, such as new orders, canceled orders, and password resets.

4. Select the template to edit:
- Click next to the email template to be edited "managerial"Button.
5. Customize e-mail content:
- In the editing interface, customize the subject line, header, and content of the email according to preferences.
6. Utilize template variables:
- If the WooCommerce Follow-ups extension is available, use template variables such as {customer_name} or {order_shipping_address} to automatically send personalized messages.
7. Additional content fields:
- Utilization."additional element" field, especially in customer-facing emails such as "Completed Orders"Email. Consider adding a thank you note to show appreciation and inject brand personality.
8. Provide useful links:
- Include links to warranty information, return policies, or other relevant documents that customers can easily access after purchase.
summarize
Setting up a WooCommerce store is pretty simple, but sometimes customizing the default email templates can get a little complicated. This article discusses how to send fully customized WooCommerce store emails to accommodate all aspects of the store's campaigns.
![图片[13]-如何自定义 WooCommerce 邮件 | 提升店铺邮件效果与顾客互动](https://www.361sale.com/wp-content/uploads/2024/12/20241212143835429-image.png)
Frequently Asked Questions
Q1.How do I customize my WooCommerce email?
Answer:The default email template can be edited from WooCommerce > Settings > Email, but this is limited to basic customizations such as colors, header images, and footer text.
Q2. Does WooCommerce send order emails?
A.Yes, WooCommerce sends order emails by default, but they are not personalized. You can follow the method I mentioned in this article.
Q3. How do I add customized email notifications to WooCommerce?
Answer:To add custom email notifications in WooCommerce, first, install the plugin and navigate to WooCommerce → Settings. In the "email" tab to edit templates, customize recipient and sender details, and adjust content using the visual editor. Save changes to configure personalized email notifications for the store.
Q4. How do I add custom fields to my WooCommerce email?
A.To add custom fields to your WooCommerce emails, in the theme'sfunctions.phpfile or a custom plugin to use this code snippet:
add_filter('woocommerce_email_order_meta_fields', 'custom_woocommerce_email_order_meta_fields', 10, 3);
function custom_woocommerce_email_order_meta_fields($fields, $sent_to_admin, $order) {
$fields['custom_field_example'] = array(
'label' => __('Custom Field Example'),
'value' => get_post_meta($order->id, 'custom_field_example', true),
);
return $fields.
}
Replace "custom_field_example" with the actual name of your custom field.
Q5. How do I customize my WordPress email?
Answer:To customize WordPress emails, install the Email Templates plugin first. Once installed, go to Appearance > Email Templates to personalize the default email template.
Q6. What are WooCommerce email templates?
A) WooCommerce email templates are pre-designed email formats for order confirmations, shipping notifications, customer invoices, and more. Customizing these templates allows store owners to match their emails with their brand identity and improve the customer experience.
Q7. How do I customize my WooCommerce email notifications?
A)To customize WooCommerce email notifications, you can use the built-in WooCommerce settings or plugins. You can adjust the layout, colors, text, etc. to match your brand. Plugins like "WooCommerce Email Customizer" make this process even easier.
Q8) Can I add my Logo to my WooCommerce email?
A)Yes, it is possible to easily add a Website Logo to a WooCommerce email by editing the email template. This can be done in the WooCommerce email settings or through third-party plugins that offer more advanced customization options.
Q9. How do I change the email subject in WooCommerce?
A)Email subject lines in WooCommerce can be changed by navigating to the WooCommerce > Settings > Email section. From there, the subject line can be customized for each email type, such as order confirmations, new customer signups, and more.
Link to this article:https://www.361sale.com/en/30196The article is copyrighted and must be reproduced with attribution.
No comments