Tips and Tricks HQ Support Portal › Forums › WP eMember › eMember – Is it possible to have email to admin after customer update profile?
- This topic has 15 replies, 8 voices, and was last updated 6 years, 5 months ago by sahmcolorado.
-
AuthorPosts
-
April 2, 2013 at 3:12 am #8849joeplcMember
Hi,
I have been using eMember.
1)I noticed that it is possible to receive email to admin after customer makes registration. I have a need to receive email to admin after customer makes updates from profile edit page. Or is there any way that the admin can know when customer makes update to their information?
2)Also I would like to know if it is possible to make multiple profile edit pages. It would be nice if I can offer cutomers different pages to make edition to some of their specific information on specific pages. thanks
April 2, 2013 at 10:48 pm #54754PeterMemberis there any way that the admin can know when customer makes update to their information?
It is not a common practice to do this. This is why eMember does not have this option. Imagine having a few thousand members and then the members updating the profile multiple times. You would end up having a flood of emails for this. If you really need this for a particular project we can do a custom job for you.
I would like to know if it is possible to make multiple profile edit pages
No, the profile edit/update works in one page.
March 13, 2015 at 4:52 am #54755Rikk03MemberQuestion,
I Have form builder addon.
Surely an additional email field can be created for the admin – only using a text field. Validate required. Prefill entry as desired email address. This then is available for selection in the forms Notification box. I know this was designed for notifying the customer of the profile changes but surely this would work also.
Regards,
R.
March 13, 2015 at 1:23 pm #54756wzpModeratorThe existing system does not have the granularity to discern partial profile updates, without a moderate amount of redesign. If you want a more detailed assessment of what it would take, please request a custom work order quote:
May 2, 2016 at 5:54 pm #54757RobertParticipantI have noticed that WordPress has a hook that allows you to create this functionality (profile_updated).
Would it be possible to add a hook to eMember on the profile update so anyone could add the admin notification on profile change themselves?
We’d simple need the same functionality as the WordPress hook (access to old data, and of course the new data).
Thanks
May 3, 2016 at 3:58 am #54758adminKeymasterThere is already an action hook for this. The following action hook is triggered after a member updates the profile from the profile edit page:
eMember_profile_updated
Example code usage:
add_action('eMember_profile_updated', 'my_custom_after_profile_update_code', 10, 2);
function my_custom_after_profile_update_code($fields, $custom_fields){
$email_address = $fields['email'];
//TODO - Do something like send an email to this member's email address.
}May 3, 2016 at 7:40 pm #54759RobertParticipantThanks…I was looking for a hook that also included the original values (before update)…is this possible?
July 25, 2017 at 2:41 am #54760sahmcoloradoSpectatorCan I use this function code without “wp_eMember_get_user_details($field_name)”? If I just have “my_custom_after_profile_update_code($fields)”, that will pass the current logged-in user’s field data?
Thanks!
July 26, 2017 at 1:00 am #54761adminKeymasterYes. That “eMember_profile_updated” action hook gets triggered after a member updates the profile. You don’t need to use it with any other shortcode.
July 26, 2017 at 1:11 am #54762sahmcoloradoSpectatorThank you!
May 21, 2018 at 9:24 am #54763tjgormanMemberThis hook is really useful to alert admin when a user updates their profile, but following up Robert’s request above – is there a someway to get the old data too so an admin can see what change has been made?
May 21, 2018 at 12:38 pm #54764wzpModerator…is there a someway to get the old data too so an admin can see what change has been made?
Unfortunately, no. Because MySQL is not a “transactional database,” and web browsing is “stateless,” there would have to be profound design changes to the plugin.
May 21, 2018 at 12:41 pm #54765tjgormanMemberNo worries – thanks!
June 17, 2018 at 6:49 am #54766sahmcoloradoSpectatorSharing for others looking to do something similar. I am using the following code to receive an email if a user changes their email address. The email displays both the old and new email address. It works great.
add_action(‘eMember_profile_updated’, ‘my_custom_after_profile_update_code’, 10, 2);
function my_custom_after_profile_update_code($fields){
$email_new = $fields;
$to = “admin_email@address.com”;
$subject = “Member Profile Updated'”;
$user = wp_eMember_get_user_details(‘user_name’);
$email_old = wp_eMember_get_user_details(’email’);
$header = “From: ” . “admin_email@address.com” . “rn”;
$message = “Member updated email address
User: ” . $user. “
New Email: ” . $email_new. “
Old Email: ” . $email_old. “
if ( $email_new !== $email_old){
mail($to,$subject,$message,$header);
}}
June 17, 2018 at 1:08 pm #54767wzpModerator@sahmcolorado — Thank you for sharing. Do you also track all other profile differences, besides the email address?
-
AuthorPosts
- You must be logged in to reply to this topic.