• Resolved vince123

    (@vince123)


    Hi All,

    Thanks for this amazing plugin, I would like to receive emails or any kind of notifications to admin or some users. When a user is updating his profile from the Edit Profile Page and also Is it possible to style Log out as a button on the Customer Dashboard page.Kindly share the solutions.

    Kind Regards,
    Vince

    • This topic was modified 7 years, 8 months ago by vince123.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Thread Starter vince123

    (@vince123)

    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.
    Plugin Author Georgian Cocora

    (@raster02)

    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.

    Thread Starter vince123

    (@vince123)

    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

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

The topic ‘Sending Emails when User Edits profile’ is closed to new replies.