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?
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
RaviHi Ravi, that’s very generous of you to provide this code.
I’ve tried the code, but all it can do is send an email anytime a user updates any aspect of their profile, which is not what I need. I need just one email sent when ALL aspects of the profile are completed – as measured but the Buddyboss profile completion widget.
Currently, the BB profile completion widget can be set to disappear when the profile is complete, so there is an existing part of the BB code that knows when a person has completed their profile…
I have opened a ticket with Buddyboss:
“Hi, I want to create a function that emails the site admin when a user completes their profile – as measured by the Buddyboss profile completion widget. The widget can be set to disappear when the profile is complete. Is there a way to call on that status?”
I will follow up here when I get an answer from them.
Thank you!
Hi Ravi, the relevant code in the Buddyboss template is found in: /buddyboss-theme/inc/plugins/elementor/widgets/bb-profile-completion.php
Line 962:
if ( ( $settings[‘switch_hide_widget’] == ‘yes’ || ! isset( $settings[‘switch_hide_widget’] ) ) && ( $user_progress[‘completion_percentage’] == 100 ) ) { ?>
It is that $user_progress[‘completion_percentage’] == 100 that I need to trigger the sending of the email.
Hello John,
Thank you for sharing the code. This piece of code will not help much. But, We need an action when the user profile gets completed so that we can use this action to notify the admin. Please contact BuddyBoss for the same they can help you with this issue.
Regards
RaviOk, I think I understand now. The function you gave me was designed to work WITH the buddy dev profile completion widget.
The problem I have is that I’m using an additional profile field group. That breaks the buddy dev profile completion widget:
Basic Info (collected at registration)
More About Me (user fills in later)So, I need the buddy dev profile completion widget to handle an extra profile field group
OR
I need a function based on
/buddyboss-platform/bp-xprofile/classes/class-bp-xprofile-profile-completion-widget.phpThat can email the admin when a user’s profile reaches 100% as measured by that widget:
if ( 100 === (int) $user_progress[‘completion_percentage’]That widget can handle multiple profile field groups.
- This reply was modified 1 year, 4 months ago by John.
You must be logged in to reply to this topic.