How do I replace username with email address in the WooCommerce new customer email?

Home / WooCommerce / How do I replace username with email address in the WooCommerce new customer email?

This is actually a fairly simple code change, but you want to make sure that you are loading the email address in that file and that you do not overwrite the file on an upgrade of WooCommerce.

First, make sure that in your active theme you create a new directory (if there isn’t one already) called “woocommerce.” Then in that folder, you need to create a folder called “emails.” For more information on overriding WooCommerce templates, see here: WooCommerce Template Structure.

Now, you will need to copy from plugins>woocommerce>templates>emails the file called “customer-new-account.php” into the directory you just created. I recommend downloading a copy, then re-uploading to the new folder.

Once you have copied this file, you can edit it without fear of it being overwritten when WooCommerce is upgraded.

Use the following code to send the email address instead of the customer username in the WooCommerce new customer email:

Leave a Reply

Your email address will not be published.