Created
May 2, 2017 22:33
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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' );
}