How to Send “Customer Invoice/Order Details” WooCommerce Email Automatically

Do you want to send “Customer Invoice / Order Details” emails to your customers? If you are looking for a step-by-step guide, keep reading this article!

Optimizing your WooCommerce store is not just a suggestion; it’s necessary to drive up your sales and conversion rates. As a customer-centric business, your WooCommerce store should always seek strategies to enhance the site.

To improve the customer experience, you can automatically send the invoice/order details to your customer’s registered email address.

It is the only email template the store owner needs to send manually. Since WooCommerce offers limited email customization options, we will use a third-party email customization plugin.

If you are looking for a complete guide on how to send customer invoices/order details to your customers, keep reading this article. Here, we will show you everything you need to know about the process.

First, let’s see why you need to send a customer invoice via email.

Why Do You Need to Send “Customer Invoice / Order Details” to Customers?

While you manage an online store, you should focus on tweaking and sending emails. The WooCommerce email settings contain all the available email templates.

all emails

They are:

  • New order
  • Cancelled order
  • Failed order
  • Order on hold
  • Processing order
  • Completed order
  • Refunded order
  • Order details
  • Customer note
  • Reset password
  • New account

And so on.

WooCommerce will automatically send emails to your customers when specific tasks occur. For example, if the customer clicks on the reset password option, WooCommerce will help them reset their account password via email.

Similarly, after they complete the payment for an order, the completed order email will be sent to the registered email address.

This will help the customer understand their order’s status without logging in to the online store.

Now you know why you need to automatically automatically send “Customer Invoice / Order Details” from WooCommerce to your customers. The following section will show you how to do it properly without errors.

How to Send “Customer Invoice / Order Details” Automatically in WooCommerce

This can be done with a bit of PHP code. We recommend not adding a PHP code to your parent theme’s functions.php file. If the theme gets an update, the files will be replaced by new ones.

So, we recommend adding this code to a child theme’s functions.php file or a site-specific plugin called Code Snippets. We will show you both methods here.

1. Editing Child Theme’s Functions.php File

If you do not have a child theme, you can use a plugin called Child Themify to create it. Once you have generated a child theme, go to the Editor. It can be found under the Appearance section.

theme editor

Next, open the functions.php file and paste the code at the end of the file.

The code we are going to use is:

add_action( 'woocommerce_order_status_pending', 'yay_send_pending_order_email', 9999, 2 );
 
function yay_send_pending_order_email( $order_id, $order ) {
 
   if ( ! $order->needs_payment() ) return;
    
   WC()->payment_gateways();
   WC()->shipping();
   WC()->mailer()->customer_invoice( $order );
 
   $order->add_order_note( __( 'Payment request automatically sent to the customer.', 'yay' ), false, true );
 
}

Once you have pasted the code, update the file.

update file

You can use the child theme method to send customer invoice/order details automatically.

2. Using Code Snippets

If you want a site-specific plugin, check out Code Snippets. With the help of Code Snippets, you can add custom code to your website without editing any theme files. Here’s how to use Code Snippet for this task.

Once you have activated the plugin on your store, you need to add a new snippet.

add new snippet

Next, enter a name for your snippet and paste the code.

automate customer order emails code

The name is just for identification. This won’t be visible in the front end. Once you have modified the code, activate it.

That’s it!

This is how you automatically can send customer invoice/order details to your WooCommerce customer.

Bonus: Adding Next Coupon Info to Email Templates

Adding coupon codes to your order emails is an excellent option to boost conversions and sales. However, WooCommerce doesn’t allow editing email templates by default.

For this, we need to use a plugin called YayMail. It is a freemium plugin. The free version is available in the WordPress plugins repository. The premium version will unlock more potential features, and you can get it from the YayCommerce website.

For this tutorial, we will use the premium version of YayMail. Once you have activated the plugin and verified the license key, you can see its settings under the YayCommerce option.

yaymail

If you haven’t created a coupon code for the discount, you can go to the Marketing section and make one.

add new coupon

You should customize the discount type, usage, and so on. Otherwise, you need to use a plugin called YayPricing to customize the coupon.

However, if you open the YayMail option, you can choose which email template to edit from the dropdown.

email templates

For example, we will tweak the order details template in this case. Once you select your preferred template from the dropdown, you can edit it.

order details template - send "Customer Invoice / Order Details"

On the left-hand side of the editor, you can see all the blocks you can use inside the email. You only need to drag the blocks from the left aise and drop them inside the email template.
Here, we will use a text block.

add text block - send "Customer Invoice / Order Details"

After adding the block, click it on, and you can see its customizations on the left-hand side.

edit text - send "Customer Invoice / Order Details"

Enter your coupon code in the text field.

coupon code added - send "Customer Invoice / Order Details"

You can always change the logo and other elements according to your preferences. Once you have modified the text, save the template and enable it.

enable template

From now on, this modified template will be used when emailing your customers. Adding coupon codes to the email can encourage repeat purchases and foster customer loyalty, giving you more control over your marketing efforts.

Conclusion

If you manage a WooCommerce store with decent sales and conversions, manually sending the customer invoices/order details can be time-consuming. Automating this process saves you time and lets you focus on more essential tasks, giving you peace of mind.

This article demonstrates that automating sending customer invoices/order details is straightforward. With a simple PHP snippet, you can add the necessary code to your child theme’s functions.php file without needing dedicated plugins.

We highly recommend doing this on your WooCommerce store.

How would you customize your emails?

Let us know in the comments!

Sreehari P Raju
Sreehari P Raju

Sreehari P Raju is a freelance WordPress content writer. He started using WordPress in 2015 and loves writing tutorials, product reviews, and listicles. While not working, he loves playing Minecraft or eating KFC.

Related Posts
Leave a Reply

Your email address will not be published.Required fields are marked *