Hi Georgina Cocora,
Thanks for the support, the solution you shared worked without any problem but what if I want to send an email notification to some other users or email IDs. What change do I have to make that work?
The code I used is as follows
add_filter(‘wppb_edit_profile_success’, ‘wppb_email_after_edit’, 10, 3);
add_filter(‘wppb_register_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 his account</p>
“;
$headers = “Content-type: text/html”;
wp_mail($to, $subject, $message, $headers);
}
Kind Regards,
Vince
-
This reply was modified 7 years, 8 months ago by
vince123.
Hello @vince123,
You can add as many recipients as you want on this line:
$to = get_option( ‘admin_email’ );
just modify it to this:
$to = array( get_option('admin_email'), 'second@mail.com', );
You’ll need their emails for that.
Regards.
Hi Georgian
Thanks for the great support, your solution worked without any flaws.
Thanks!
I have a similar request. My client wants to receive an email showing what fields the user changed. How can I capture this information?
Thanks!
Selena Smith