BuddyDev

Search

Need a way to notify admin of profile completion…

  • Participant
    Level: Initiated
    Posts: 8
    John on #49598

    Hi, I’ve decided to create a kind of holding area on my site for new members. I want to give them access to certain content but limit their community access until they’ve completed their profile.

    I’m using the buddydev profile completion plugin, but I’d prefer to just be able to get an admin notification or email when a user completes their profile.

    Possible?

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2606
    Ravi on #49599

    Hello John,

    Thank you for using BuddyPress Profile Completion plugin, Please use the following code to notify site admin on profile completion.

    
    
    add_action( 'bpprocn_user_profile_completed', function ( $user_id ) {
    
    	if ( ! function_exists( 'buddypress' ) ) {
    		return;
    	}
    
    	$admin_email = get_option( 'admin_email', '' );
    
    	$subject = __( 'New user profile completed' );
    	$message = __( 'User profile completed: ' ) . bp_core_get_user_displayname( $user_id ) . ' (' . bp_core_get_user_domain( $user_id ) . ')';
    
    	@wp_mail( $admin_email, $subject, $message );
    } );
    
    

    Please give it a try.

    Regards
    Ravi

You must be logged in to reply to this topic.

This topic is: not resolved