Last active
November 18, 2019 18:16
-
-
Save jessepearson/3854b19fee67f6c779bbe746cb649b5f to your computer and use it in GitHub Desktop.
Will send the WordPress New User email to the admin if the site when new user/customer is added through WooCommerce
This file contains hidden or 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 // do not copy this line | |
/** | |
* In case you'd like to send an email to the admin when a new customer is created in WooCommerce. | |
* @param int $user_id New user's ID | |
*/ | |
function send_wc_admin_new_user_notification( $user_id ) { | |
wp_send_new_user_notifications( $user_id, 'admin' ); | |
} | |
add_action( 'woocommerce_new_customer', 'send_wc_admin_new_user_notification' ); | |
add_action( 'woocommerce_created_customer', 'send_wc_admin_new_user_notification' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment