Skip to content

Instantly share code, notes, and snippets.

@jessepearson
Last active November 18, 2019 18:16
Show Gist options
  • Save jessepearson/3854b19fee67f6c779bbe746cb649b5f to your computer and use it in GitHub Desktop.
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
<?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