Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsmereal/14d17ffde54e6fa52d413dd147e36030 to your computer and use it in GitHub Desktop.
Save itsmereal/14d17ffde54e6fa52d413dd147e36030 to your computer and use it in GitHub Desktop.
[General Snippets] Notify admin when a new customer account is created and user meta data is saved
<?php
/**
* Notify admin when a new customer account is created and user meta data is saved
* So, you can show user meta data like 'billing_phone' in the email
*/
add_action( 'woocommerce_checkout_update_user_meta', '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