WordPress triggers a custom hook when certain meta is updated, user meta counts. See updated_{$meta_type}_meta
. Here’s an example use case:
add_action('updated_user_meta', function( $meta_id, $user_id, $meta_key, $_meta_value ) {
switch ( $meta_key ) {
case 'mobile_number':
case 'address':
$user = new \WP_User($user_id);
// user
wp_mail($user->user_email, 'Profile updated', 'Profile updated.');
// admin
wp_mail(get_bloginfo('admin_email'), 'Profile updated', "Profile updated for user {$user->display_name}.");
break;
}
}, 0, 4);