How to Easily Customize WooCommerce Emails
No WooCommerce store could continue to do business without a series of well-written and properly planned emails. Every customer-action from initial placement of the order to the final fulfillment often triggers an email. The good news is that it is easy to customize WooCommerce emails, right within the WooCommerce Admin area.
SEE: 5 Ways To Speed Up Your WooCommerce Store
Store owners have access to simple yet powerful email customization options located under Emails > Email Sender Options. using these option, store owners could add custom header images, footer text, store’s name in the FROM field, amongst other customization options. As a result, the customers receive emails that fully reflect the store’s branding.
Customizing WooCommerce Email Templates
WooCommerce email templates generally cover the entire ecommerce process from initial “Thank You for your Order” email to the final invoice email. In addition, the email templates also cover user management emails such as new customer registration email and password reset email.
To illustrate how store owners could customize WooCommerce emails. I will describe the customization of Processing Order email template.
To access the template, go to WooCommerce > Settings > Emails > Processing order. As you can see, almost all fields including the email subject and the HTML template could be fully customized. The best part is the additional control over the process by enabling or disabling the sending of the email as part of the store email notification process.
The above process could be used to customize all the available email templates in the email section.
Using WooCommerce Hooks
Another way of customizing WooCommerce email templates is through WooCommerce hooks.
These hooks should be placed in the functions.php file located in the installed theme folder. Alternatively, you can make a seperate file (or a plugin) with the following code:
1 2 3 4 5 6 7 |
add_action( 'woocommerce_email_header', 'wpblog_additional_header',10,2 ); function wpblog_additional_header( $email_heading, $email ) { echo "<p> Cheers on behalf of shopping our store. At this time is your statement</p>"; } |
The following screenshot shows the hook in action. You can easily customize the message by adding your own in the echo statement.
The following hook outputs the order details:
1 2 3 4 5 6 7 |
add_action( 'woocommerce_order_item_meta_start', 'wpblog_item_order', 10, 2 ); function wpblog_item_order( $item_id, $item, $order, $plain_text ){ echo '<p> Your custom text</p>'; } |
The above code snippet has four important variables, $item_id (item id, required for tracking the order), $item (the quantity ordered), $order (the details of the order) and $plain_text (additional order information).
Conclusion
As you can see, it is easy to customize WooCommerce emails. In many cases, custom emails are a great way of alerting the customers about the progress of their order. The process is very simple and most of the work could be done from right within the WooCommerce option menu.
Create Faster WordPress Websites!
Free eBook on WordPress Performance right in your inbox.