Notify Admin On WooCommerce User Registration

LinkedIn Pinterest

As web site admin, I am so happy when receiving this kind of email, user registration notification. By default, WordPress will send web site admin notification email upon user registration. However I received none since I’ve used WooCommerce Custom Fields on REGISTER form. The web site didn’t notify admin (me) on user registration.

Notify Admin On WooCommerce User Registration

If we are using WooCommerce, user registration will done through process_registration action in WooCommerce. At that time, WordPress never send email notification to admin about new user. It only sends notification email for new orders. So to sort this out, we are going to call wp_new_user_notification WordPress notification function during new user registration by WooCommerce via woocommerce_created_customer hook.

function admin_email_on_registration( $customer_id) {
wp_new_user_notification( $customer_id );
add_action(‘woocommerce_created_customer’, ‘admin_email_on_registration’, 10 , 1);


About Author

Hien Nguyen is an experienced Software QA Engineer. A tester by day and a blogger by night, Hien has a great passion for software testing, especially complex test automation problems. When not doing all those, he enjoys reading, jogging and trying new things.

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.