Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce - Send "New User Registration" email to admins when new customer is created.
<?php
/**
* Send "New User Registration" email to admins when new customer is created on WooCommerce.
*
* @param int $id New customer ID.
*/
function my_wc_customer_created_notification( $id ) {
wp_new_user_notification( $id, null, 'admin' );
}
add_action( 'woocommerce_created_customer', 'my_wc_customer_created_notification' );
@Cpt-Randall

This comment has been minimized.

Copy link

Cpt-Randall commented Aug 29, 2017

Where is the above code supposed to be placed?
Thanks

@matthewdean89

This comment has been minimized.

Copy link

matthewdean89 commented Oct 18, 2017

CPT-Randall, place it in your functions.php file (without the <?php)

Cheers,

@tenaki

This comment has been minimized.

Copy link

tenaki commented Dec 5, 2017

Can I create an overide for this to stop functions.php changing back when woocommerce updates?

@ctuxboy

This comment has been minimized.

Copy link

ctuxboy commented Mar 14, 2018

Try it, but doesn't work. Or i do it wrong. Adding the code in the functions.php of my Child-theme.

@Erenor

This comment has been minimized.

Copy link

Erenor commented May 28, 2018

You should DEFINITELY make changes to the functions.php of your child-theme. The main theme's files are supposed to be overriden when the theme updates :-)

@jeffjeffz

This comment has been minimized.

Copy link

jeffjeffz commented Jun 14, 2018

Worked Perfect. Thanks!

@rtirak

This comment has been minimized.

Copy link

rtirak commented Oct 5, 2018

Is it possible to get the username and the password that the user selected? They are getting an email that says the username and password that they signed up with, however we need our admin to get the username and password as well so there account can be created in another system with the same info.

@devianaa

This comment has been minimized.

Copy link

devianaa commented Feb 1, 2019

I need Woocommerce to send Refund and Return" email to admins when a new customer returns and refund the order.
Please Response back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.