• Can someone *please* confirm that this code actually works with WP 4.9.6, and UM 2.0.17 ? It used to work for me, but stopped a few weeks ago, Ninja Forms still sends out email, so mail is leaving server.

    This is in the bottom of my functions.php file. Any and all help is greatly appreciated!!!

    // Run on successful submit profile form
    add_action('um_user_edit_profile', 'um_post_edit_pending_hook', 10, 1);
    function um_post_edit_pending_hook($args) {
    $user_id = $args['user_id'];
    get_currentuserinfo();
    
    	if ( is_user_logged_in() ) {
    
    	$to 		= $current_user->user_email;
    	$subject 	= $current_user->user_firstname . ' ' . $current_user->user_lastname . ' has updated their profile';
    	$message 	= 'You will receive this email when a user edits their profile.';
    
    	wp_mail( $to, $subject, $message );
    
    	}
    
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support mansurahamed

    (@mansurahamed)

    Hi @wwwcre8r,

    Please remove the previous code and use following instead. I have tested it, it sent’s email when user edit and updates his profile. Please change the $to and subject of email according to your requirement.

    add_action( ‘um_user_after_updating_profile’, ‘my_user_after_updating_profile’, 10, 1 );

    function my_user_after_updating_profile( $submitted ) {

    get_currentuserinfo();

    if ( is_user_logged_in() ) {

    $to = ‘john.doe@example.com’;
    $subject = ‘User has updated their profile’;
    $message = ‘You will receive this email when a user edits their profile.’;

    wp_mail( $to, $subject, $message );

    }

    }

    Thread Starter wwwcre8r

    (@wwwcre8r)

    This code you sent did not work for me. Note that previously the function was working fine, then just stopped. I figure a WP core or plugin update caused it.

    I’ve since tried your code on three (3) separate environments (three different hosts) and it still doesn’t work. Two (2) of those environments are brand-new, with no other plugins installed.

    I did afterward install Ninja Forms to prove that mail is being sent from the server though.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Run on successful submit profile form’ is closed to new replies.