Skip to content

Instantly share code, notes, and snippets.

@claudiosanches
Created May 2, 2017 22:33
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save claudiosanches/755fbc92941830eebda46151fc57688f to your computer and use it in GitHub Desktop.
Save claudiosanches/755fbc92941830eebda46151fc57688f to your computer and use it in GitHub Desktop.
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' );
@rtirak
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
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.

@musaib-technyx
Copy link

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' );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment