How to Customize WooCommerce Order Emails

by Owais Alam  October 11, 2016

You have worked hard to set up your WooCommerce store. The product page is now connected to a flawlessly working database and the checkout process has got no problems. The theme is customized to reflect the colors and style of your brand.

Then you decide to send an email out and discover that it is rather bland and generic. This single email, however, can render all your efforts at customizing your WooCommerce store useless.

Many WooCommerce store owners and administrators have this common query: How can I modify the default WooCommerce request messages to have my brand’s look and feel and how can I add additional content to help clients with their order as well as how to create WooCommerce custom order status.

WooCommerce Order Emails

While making impressive HTML emails is truly an achievement in itself,  WooCommerce offers several options so that even amateurs could create some amazing emails.

Customer Emails

“Vanilla” WooCommerce offers email notifications that are sent to customers in response to their interactions with the store. The following are the most important emails for the customers of your WooCommerce store.

  • New Order:  New order emails are sent when a new order is received.
  • Cancelled Order: Cancelled order emails are sent when order(s) has been marked as cancelled.  
  • Failed Order: Failed order emails are sent when an under processing or on-hold order is marked as Fail.
  • Order On hold: This is an order notification sent to customers. It contains order details after an order is placed on-hold.
  • Processing Order: This is an order notification sent to customers. It contains order details after payment.Completed Order:  Order complete emails are sent to customers when their orders are marked completed. These emails usually indicate that the orders have been shipped.
  • Refunded Order: Order refunded emails are sent to customers when their orders are marked refunded.
  • Customer Invoice: Customer invoice emails contain order information and payment links.
  • Customer Note: Customer note emails are sent when you add a note to an order.Reset Password: Customer “reset password” emails are sent when customers reset their passwords.
  • New Account: Customer “new account” emails are sent to the customer when a customer signs up via checkout or account sign up page.

In addition to these standard email types, you can add customized emails as well.

WooCommerce Global Email Options

The standard WooCommerce email looks like this:

New Customer Order

The WooCommerce admin allows some basic customization of this default email layout. These options could be accessed after logging in to the WordPress Admin and going to WooCommerce > Settings > Emails > Email  Sender Options. These options include:

  • Set the From name/address (visible to customer)
  • Add a header image
  • Change the email footer text
  • Choose different base, background, and body text colors

WooCommerce Email Option

order details

Remember that these choices apply to all emails. In just a matter of minutes, you can create a highly customized email by altering and setting a header image, custom footer text, and another base color.

Email template

You might have noticed that the WooCommerce identified that a bright base color was used. To compensate, it used a suitable shade for the title. Unfortunately, this logic was not applied to the footer’s content. This mishap can easily be fixed manually!  

WooCommerce Email Specific Options

Every email type has its own set of customization options. These options can be accessed through WooCommerce > Settings > Emails > Processing order (This example path focuses on Processing Order Emails. You can alter several aspects of the email, including:  

  • Enable or Disable whether the email is even sent at all
  • The email’s subject
  • Email heading (The default is “Thank you for your order”)
  • Whether the email is sent as HTML or plain text (The default option is HTML)

Processing Ordder

Here, I have set the custom email heading as ‘Thank You For Your Order.’

Thank you message

Overriding Email Templates

A more effective and efficient approach is to modify the default email layouts. WooCommerce offers a helpful template system that allows you to customize parts of your store or emails by replicating the format file(s) into the theme. Every email type has a template file for its content (For example, woocommerce/templates/emails/customer-process-order.php). In addition, there are shared templates that all email types can access and use. These could be found at  woocommerce/templates/emails/email-styles.php. In many cases, this is the template that developers override to change shared aspects of the emails. The process of dealing with the footer issue mentioned earlier is:

  1. First you make sure that the following directory exists in the WordPress installation: wp-content/themes/your-theme/woocommerce/emails.
  2. Next, copy the file found at wp-content/plugins/woocommerce/templates/emails/email-styles.php into the store’s theme at: your-theme/woocommerce/emails/.
  3. Finally, edit your-theme/woocommerce/emails/email-styles.php to change the footer text color to black (for brevity, only the relevant part of the template file code is shown):

This generates a much more readable footer:

image05

Conditional Customization with Actions/Filters

The final and most effective approach to customizing emails is to work with WooCommerce custom code. This obviously requires a high-level of expertise in PHP. The good news is that the process is straightforward because the original WooCommerce layouts are still in use. The process involves changing portions of the content.

Filter Functions

Actions Functions

Activation/Deactivation/Uninstall Functions

For this example, I will add some helpful payment instructions to the email, based on the checkout payment type used.

To start, add the following to the theme’s functions.php:

If the customer opted for “Cash on Delivery” when checking out, the customer will receive the email with helpful order instructions:

Email Instructions

Plugin/Payment Gateway Options

Several plugins and payment gateways actually allow you to customize parts of the order emails. For instance, the built-in bank/wire transfer payment method allows you to configure instructions and insert wire transfer information. This could be done easily through  WooCommerce > Settings > Checkout > BACS.

WooCommerce Checkout setting

Although it’s uncommon, it is good to know that these options are available. This information could also help you in opting for a particular plugin for the store.

Conclusion

In this article, I discussed changing WooCommerce emails to accommodate all aspects of the store’s activities. I also highlighted the way in which the templates can be altered to insert store-specific and order-specific information in emails.

Leave a comment below if you wish to add to the discussion or ask a question!

Start Creating Web Apps on Managed Cloud Servers Now!

Easy Web App Deployment for Agencies, Developers and E-Commerce Industry

About Owais Alam

is the WordPress Community Manager at Cloudways - A Managed WooCommerce Hosting Platform and a seasoned PHP developer. He loves to develop all sorts of websites on WordPress and is in love with WooCommerce in particular. You can email him at owais.alam@cloudways.com

Stay Connected:

You Might Also Like...