Emails

WooCommerce Custom Content Under New Order Email Heading

WooCommerce New Order email showing custom content under header

Pre-Requisites

There are no pre-requisites in order for you to be able to implement this solution.

How To Implement This Solution?

Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.

About This Solution

As you know, editing the WooCommerce template core files is a big fat no-no for security and update purposes. If you need to make edits to the emails, you’re much better off doing this by targeting the email ID and using hooks as necessary. This quick guide shows you how you can target the New Order email which is sent to the store admin to notify them of a new sale. More specifically, how to add custom content under the header in this specific email to meet the needs of your business.

/*
* Snippet Name:		Display custom content under New Order email header
* Snippet Author:	ecommercehints.com
*/

function ecommercehints_email_header_custom_content( $email_heading, $email ) {
    if ($email->id == 'new_order') {
	echo "<p>Nice one, you've got a new order!</p>";
	}
};

add_action( 'woocommerce_email_header', 'ecommercehints_email_header_custom_content', 20, 2);

Snippet Benefits

  • Customise the New Order email which is sent to the store admin to notify them of a new sale.

100 WooCommerce Conversion Rate Optimisation Tips

This field is for validation purposes and should be left unchanged.

Let’s collaborate!

Need to outsource WordPress development?

Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.

First Timer Here?

Sign up to receive 20% off on your first month with us.

26027
WELCOME OFFER