WooCommerce: Add Content To “New Account” Welcome Email

First impressions matter, especially in ecommerce. When a customer creates an account on your WooCommerce store, the “Your {site_title} account has been created!” welcome email is your golden opportunity to solidify a positive connection.

However, the standard WooCommerce email might fall short:

Hi Rodolfo,

Thanks for creating an account on {site_title}. Your username is ____. You can access your account area to view orders, change your password, and more at: ___

Click here to set your new password.

This tutorial teaches you how to display additional content in the “welcome” email. You can then personalize greetings, showcase your brand story, and strategically introduce features like exclusive offers or product recommendations. By tailoring these emails, you’ll not only provide valuable information but also nurture customer loyalty and encourage them to explore your offerings further.

Enjoy!

Yes, on paper you can use the “Additional content” textarea to add content below the default one. But you can’t use PHP there in case you need to access customer data for example. So, the snippet below will give you more flexibility.

PHP Snippet: Add Content To The WooCommerce “New Account” Customer Email

The “New Account” email comes with no template hooks, unlike most of the order emails.

This means the only chance we have to inject our custom content is above the email footer – the hook is ‘woocommerce_email_footer‘ – with priority less than 10, because that’s when the footer is hooked by default.

So we will use priority 9:

add_action( 'woocommerce_email_footer', function( $email ) {
   // do something
}, 9 );

After that, we need to identify if we’re on the correct email. Thankfully, we have the $email parameter, and we can check:

if ( $email instanceof WC_Email_Customer_New_Account ) {
   // do something
}

Now we can echo any HTML content: paragraphs, images, links, and even get access to the customer details via PHP thanks to the $email object. Here’s the full code:

/**
 * @snippet       Add Content @ WooCommerce New Account Email
 * @how-to        businessbloomer.com/woocommerce-customization
 * @author        Rodolfo Melogli, Business Bloomer
 * @compatible    WooCommerce 8
 * @community     https://businessbloomer.com/club/
 */

add_action( 'woocommerce_email_footer', 'bbloomer_add_content_new_account_email', 9 );

function bbloomer_add_content_new_account_email( $email ) {	
	
	if ( $email instanceof WC_Email_Customer_New_Account ) {
		
		echo '<hr>';
		echo '<h2>Some heading</h2>';
		echo '<p>A paragraph, and an image below it</p>';
		echo '<img src="banner.jpg">';
			
		// $user_id = $email->object->ID; // get user ID
		// $customer = new WC_Customer( $user_id ); // get customer object 
		
		// IF YOU HAVE A CUSTOM REGISTRATION FORM
		// e.g. businessbloomer.com/shop/plugins/woocommerce-add-customer-fields-to-my-account-registration-form/
		// YOU MAY ALREADY HAVE ACCESS TO:
		$first_name = $customer->get_billing_first_name();
		$last_name = $customer->get_billing_last_name();
		$country = $customer->get_billing_country();
		//etc.
		
	}
	
}

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

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