Send email to Admin when user/member updates specific user/member data

I have previously asked about How to automatically send email to Admin when a user/member changes his/hers profile data. And got some very good answers.
Send automatic mail to Admin when user/member changes/adds profile

Now a follow up: I only want to send/email the data (profiledata) that was updated/added.

2 Answers
2

So, as Bainternet notes, you would need to compare the new field value to what it was right before the edit. In essence, you will need to build in version control for the profile fields. You will need to add a database table to store this info, using the the $wpdb object to write, and read from it.

Basically, on personal_options_update and edit_user_profile_update you will glean the data as in the previous answer, but then also compare it to your table storing the what existed in the previous save. You’ll only send a particular field’s data if there is mismatch.

Leave a Comment