How to Add WooCommerce Custom Email per Product

Nearly half of all websites on the Internet use WordPress as their content management system (CMS). We’re not at all surprised by this number. Compared to other CMS, WordPress is leaps and bounds easier to use and more flexible.

WordPress also comes with a rich ecosystem of plugins. Plugins are small programs allowing users to quickly modify the website designs and functions to suit their needs. Online sellers, for example, can use WordPress plugins like WooCommerce to build their online stores.

If you’re a WooCommerce user, have you ever wondered how many WooCommerce custom emails per product you can have? This guide has the answer!

What Is WooCommerce Custom Email Per Product?

WooCommerce gives you the ability to send emails out to all of your customers.

It provides you with many email templates that can activate depending on what the customer does in your shop. WooCommerce sends emails to customers and you (the store admin) alike, depending on the template.

For example, when customers make new orders, they’ll activate the “New Order” template, which sends notification emails to you.

Then, once they have paid for the orders, the “Processing Order” template will be activated. WooCommerce will send emails with the order info to the customers’ inboxes.

WooCommerce has up to a dozen of these auto-templates.

ppwp-default-woocommerce-email-templates

But did you know that the email templates on WooCommerce can also be extensively customized?

You can use it to send your customers a personalized email tailored specifically to the product that they bought. So, if a person buys a product, the email they receive will be different from another person who buys a different product on your website.

How to Add WooCommerce Custom Email per Product

There are many different approaches to add custom email per product in WooCommerce. In this guide, we’ll show you the 3 easiest ones.

#1 Using Plugin

The WooCommerce plugin solves the problem of setting up an eCommerce store in WordPress for you. Just like WooCommerce, there are plugins out there that can help you set up custom emails for WooCommerce, too.

Custom Emails for WooCommerce is one such email customizer WooCommerce plugin.

ppwp-custom-emails-for-woocommerce-plugin

After installing and setting it up, you’ll be able to perform many special tasks relating to custom emails. For example, you can set up Triggers that activate whenever there are changes in your WooCommerce store.

Someone put in a new order? You can send them a custom email thanking them for their patronage, details of their orders, and shipping estimates.

Then, when the order is marked as Completed, it can be set to send the customer a personalized thank-you email.

In addition to setting Triggers, this plugin also offers extra functions like delay sending. This gives you the ability to include or exclude certain products from your mailing lists, and more.

The plugin is free to download and install. But you need to buy its premium version to get all the features. The free version allows you to set up one custom email per product.

#2 Customizing WooCommerce Emails via Dashboard

WooCommerce allows you to modify all email templates via the plugin’s dashboard. To do that, you need to copy and move the email templates from the plugin to your theme.

Navigate the WooCommerce plugin menu from your WordPress admin area. Then go to Settings > Emails.

Here, you’ll see all the email templates your website currently has. Next to each one, you’ll find the Settings/Manage button.

Click on it, and you’ll be presented with an editing interface. This is where you can change the template’s email subject, heading, and content.

ppwp-manage-woocommerce-email-templates

Other than editing these default templates, you can also add your own custom ones as well. This one is like adding special emails for each product in your store.

#3 Modifying WooCommerce Emails with Codes

While adding custom WooCommerce emails using the dashboard is easy and quick, coding is a more flexible solution.

There are many ways for you to code in new custom emails. Better yet, you can do this without having to change anything in the plugin itself. This is because every email template is a separate file, like:

woocommerce/templates/emails/customer-new-order-made.php

You only need to modify this file if you need anything in it changed.

Also, there are special templates that every email type can use, which can be found at:

woocommerce/templates/emails/email-styles.php

Customizing Email Content by Products Purchased

To create special emails based on the product that a customer purchases, apply this code to your WooCommerce plugin. Modify it to suit your needs.

add_action('woocommerce_email_order_details', 'uiwc_email_order_details_products', 1, 4);

function uiwc_email_order_details_products($order, $admin, $plain, $email) {
$status = $order->get_status();

// checking if it's the order status we want
if ( $status == "completed" ) {

// the IDs of our VIP products
$prod_arr = array( 21, 37, 85 );

// getting the order products
$items = $order->get_items();

// starting the bought products variable
$bought = false;

// let's loop through each of them
foreach ( $items as $item ) {

// checking if the ordered product is a VIP product
if ( in_array( $item['product_id'], $prod_arr ) ) {
$bought = true;
}
}

if ( $bought ) {

//using WP's function for localization
echo __( '<strong>Premium offer:</strong> Your ordered products puts you in our VIP list.
You can <a href="#">sign up for it here</a>.', 'uiwc' );
}
}
}

Modifying Email Content by Order Value

If you want to send your customers a special message or offer once the total value of their order exceeds a certain amount (let’s say $100), this section is for you. You can use this code snippet and change it into the message you want. Be it a nice “Thank-You” or a discount code for future purchases.

add_action('woocommerce_email_order_details', 'uiwc_email_order_details', 1, 4);

function uiwc_email_order_details($order, $admin, $plain, $email) {

$total = $order->get_total();

$status = $order->get_status();

if ( $total >= 100) {

if ( $status == "completed" ) {

//using WordPress' function for localization
echo __( '<strong>Discount code:</strong> Thank you for your purchase.
You can redeem it in future purchases at <a href="#">our store</a>.', 'uiwc' );
}
}

}

Sending Emails to All Customers Who Bought a Product

Want to email everyone who bought a product at your store, either for a promotional or a reach-out campaign? You can compose an email and bulk-send it using professional email clients like MailChimp. It helps you set up a mass email system.

ppwp-mailchimp-email-campaigns

Tip: There are some situations where you want to grant access to password-protected content for those who have joined your email list. Check out the steps to send passwords automatically once a visitor subscribes to your MailChimp list.

Sending Custom Emails to Win Over Your Customers!

And that’s how to send custom emails in WooCommerce.

Custom emails can be a great way to maintain a line of communication with your customers after buying something from your website.

Your clients will appreciate the unique and highly personal experience these custom emails give them. They’ll be more likely to return and buy more in the future or recommend you to their friends and contacts.

Hope this guide on setting up WooCommerce custom email per product has helped you find the answer you need. If you have any queries, please don’t hesitate to let us know in the comment section below.