Recibe an email when somebody update his profile
-
I need to know when my users updates his profiles, and I need to recibe an email saying who change his datas and what datas changes.
I found this code
/** * Updated User Profile Notification * * Every time a user updates his/her profile an email is sent * to the site administrator. * * @author Nate Jacobs * @link https://gist.github.com/1286583 */ add_action( 'profile_update', 'ngtj_updated_user_profile_notify', 10, 2 ); function ngtj_updated_user_profile_notify( $user_id, $old_user_data ) { // get the user data into an object $user = get_userdata( $user_id ); // get the site administrator's email address $admin_email = get_option( 'admin_email' ); // the email body $message = sprintf( __( 'This user has updated their profile on your site: %s' ), get_option('blogname') ) . "\r\n\r\n"; $message .= sprintf( __( 'Display Name: %s' ), $user->display_name ). "\r\n\r\n"; $message .= sprintf( __( 'Username: %s' ), $user->user_login ). "\r\n\r\n"; $message .= sprintf( __( 'Old Email: %s' ), $old_user_data->user_email ). "\r\n\r\n"; $message .= sprintf( __( 'Email: %s' ), $user->user_email ); // send the email wp_mail( $admin_email, sprintf( __( '[%s] User Updated a Profile' ), get_option('blogname') ), $message ); }
But only say that somebody change the profile, but don’t say whats fields changes. Can anybody help me?
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Recibe an email when somebody update his profile’ is closed to new replies.