Send an email if a user updates their profile (7 posts)

  1. Clicknathan
    Posted 4 years ago #

    Anyone know of a plugin or functions.php method to make WP send an email to a user when their profile has been updated?

    The topic was asked here: http://wordpress.org/support/topic/forcing-users-to-reconfirm-if-they-change-their-email-address?replies=1

    ...but has no replies. I've searched the forums and google every which way I could think of with no results.

    Any ideas?

  2. NateJacobs
    Posted 4 years ago #

    This function will send an email to the site administrator once a user has updated their profile.


    You can easily remove the site administrator's email and use the user's email instead.

  3. Clicknathan
    Posted 4 years ago #

    Nice, gave it a try and it indeed does work wonderfully.

    Except that changing the email address from the admin's to the user sends an email to the updated address....so if someone changed the address from validuser@mysite.com to malicious@hackertype.com, only the hacker, not the original user, would get the email...

  4. NateJacobs
    Posted 4 years ago #

    I think you can get the old email address. Let me check on that.

  5. NateJacobs
    Posted 4 years ago #

    I updated the function to now print out the old and updated email addresses.

    You can access all the old (pre update) field values using the $old_user_data object.

  6. desktopanywhere
    Posted 4 years ago #

    Thanks. This https://gist.github.com/1286583
    worked great for me and I posted a comment on that page on not only how useful and easy it was to add, but what it did for my site when used in conjunction with the "amr users" plug in and Justin Tadlocks adding and using custom fields code.

    Great stuff. Thanks,



  7. abis221
    Posted 3 years ago #

    I need exactly this thing to my website. Can you please explain how to use it?

Topic Closed

This topic has been closed to new replies.

About this Topic