Title: Email when user changes profile
Last modified: June 12, 2018

---

# Email when user changes profile

 *  Resolved [selenasmith](https://wordpress.org/support/users/selenasmith/)
 * (@selenasmith)
 * [8 years ago](https://wordpress.org/support/topic/email-when-user-changes-profile/)
 * I have 2 issues:
 * 1. My client wants to receive an email when the user updates their profile. I’m
   using the following code but I’m not sure where to put it. I created a plugin
   but I get the error message “syntax error, unexpected ‘add_filter'(T_STRING) (
   34,1)”
 *     ```
       add_filter ( 'wppb_edit_profile_success', 'wppb_email_after_edit', 10, 3 );
       function wppb_email_after_edit($request, $form_name, $user_id){
          // for more information about wp_get_current_user please see http://codex.wordpress.org/Function_Reference/wp_get_current_user
          // this is useful in case you want something more then just the user_login and ID
          if ( $form_name == 'edit_profile' ){
             $user_id = get_current_user_id();
          }
        
          $user = get_user_by('id', $user_id);
          $url = admin_url("/user-edit.php?user_id=$user_id");
        
          $to = get_option( 'admin_email' );
          $subject = "User: $user->user_login succesfully edited his account.";
          $message = "<p>User: $user->user_login succesfully edited or registered his account. View his account at <a href='$url'>his account</a></p>";
          $headers = "Content-type: text/html";
        
          wp_mail($to, $subject, $message, $headers);
       }
       ```
   
 * 2. The user wants to know what fields the user changed. How can I capture this
   information in the email?
 * Thanks!
    Selena Smith

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Georgian Cocora](https://wordpress.org/support/users/raster02/)
 * (@raster02)
 * [8 years ago](https://wordpress.org/support/topic/email-when-user-changes-profile/#post-10391464)
 * Hello [@selenasmith](https://wordpress.org/support/users/selenasmith/),
 * Please [open a ticket](https://www.cozmoslabs.com/support/open-ticket/) on our
   website and link to this thread.
 * Regards.
 *  Thread Starter [selenasmith](https://wordpress.org/support/users/selenasmith/)
 * (@selenasmith)
 * [8 years ago](https://wordpress.org/support/topic/email-when-user-changes-profile/#post-10391781)
 * Done.
 * Thanks!
    Selena Smith

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Email when user changes profile’ is closed to new replies.

 * ![](https://ps.w.org/profile-builder/assets/icon-256x256.png?rev=2961144)
 * [User Profile Builder - Beautiful User Registration Forms, User Profiles & User Role Editor](https://wordpress.org/plugins/profile-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/profile-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/profile-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/profile-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/profile-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/profile-builder/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [selenasmith](https://wordpress.org/support/users/selenasmith/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/email-when-user-changes-profile/#post-10391781)
 * Status: resolved