25th Anniversary Savings | 25% Off Dedicated Servers*Shop Now
25th Anniversary Savings | 25% Off VPS Hosting* †††Shop Now
Limited Inventory: High-Performance AMD-Powered Servers Now Available.* Shop Now >
Dedicated Hosting Deals | From $99/moShop Now

Setup WooCommerce Notifications When New Account Is Created

Posted on by AJ Morris
Reading Time: < 1 minute

Keeping track of customer accounts is important, and if you want a site administrator to receive a notification that’s a simple task. You can add this code snippet via the Code Snippets plugin (recommended), or manually by pasting it into your theme’s functions.php file:

<?php // Do not include this if already open!

/**
 * Code goes in theme functions.php.
 */

add_action( 'woocommerce_created_customer', 'woocommerce_created_customer_admin_notification' );

function woocommerce_created_customer_admin_notification( $customer_id ) {
  wp_send_new_user_notifications( $customer_id, 'admin' );
}

Just change "admin" with the username you want the emails to go to.

Happy Modding!

About the Author: AJ Morris

AJ Morris is the Product Innovation and Marketing Manager at iThemes. He’s been involved in the WordPress community for over a decade focusing on building, designing and launching WordPress websites and businesses.

Latest Articles

What Is WebP and What Makes it Different from Other Image Formats?

Read Article

Top 10 Password Security Standards

Read Article

Top 10 Password Security Standards

Read Article

How to Install MongoDB on AlmaLinux

Read Article

How to Use the WP Toolkit to Secure and Update WordPress

Read Article