Skip to:
Content
Pages
Categories
Search
Top
Bottom

Confirmation Email


  • Dono12
    Participant

    @dono12

    I’m using Cymi User Extra Field, when you enable email confirmation the user gets the Buddypress email template
    with the confirmation link. when the user clicks the link it takes them to the confirmation page of the site prompting them
    to login with username and password. Problem is the user name and password doesnt work. The user gets created because they
    are visible in the users list. How can I fix this problem.
    I’ve disabled the Buddypress sign up for the default WordPress using: BP CUSTOM

    function my_disable_bp_registration() {
      remove_action( 'bp_init',    'bp_core_wpsignup_redirect' );
      remove_action( 'bp_screens', 'bp_core_screen_signup' );
    }
    add_action( 'bp_loaded', 'my_disable_bp_registration' );
    add_filter( 'bp_get_signup_page', "firmasite_redirect_bp_signup_page");
        function firmasite_redirect_bp_signup_page($page ){
            return bp_get_root_domain() . '/wp-login.php?action=register'; 
     }

    and I found this code in a Buddpress Forum:

    https://buddypress.trac.wordpress.org/ticket/3443

    // Change the text on the signup page

    add_filter( 'bp_registration_needs_activation', '__return_false' );
    
    function my_disable_activation( $user, $user_email, $key, $meta = '' ) {
    	// Activate the user
    	bp_core_activate_signup( $key );
    
    	// Return false so no email sent
    	return false;
    }
    add_filter( 'wpmu_signup_user_notification', 'my_disable_activation', 10, 4 );
    
    

    I tried it with the hope that the key would be disabled and the key fired by WordPress would take over but it still didnt work.

    I really don’t care who fires the key I just want the user to be able to login after click the key in their email.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’m not sure what behavior you’re aiming for, but this snippet will disable the confirmation email and log the user in automatically upon successful registration.

    <?php 
    add_action( 'bp_core_signup_user', array( $this, 'disable_validation_of_new_users' ) );
    add_filter( 'bp_registration_needs_activation', '__return_false' );
    add_filter( 'bp_core_signup_send_activation_key', '__return_false' );
    
    function disable_validation_of_new_users( $user_id ) {
    
    	// Get the user's activation key for BP. This is the activation_key in user_meta, not the key in the user table.
    	$user_key = get_user_meta( $user_id, 'activation_key', TRUE );
    
    	// Activate the signup
    	$awuser = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $user_key ) );
    
    	// Automatically log the user in.
    	// Thanks to Justin Klein's  wp-fb-autoconnect plugin for the basic code to login automatically
    	$user_info = get_userdata($user_id);
    	wp_set_auth_cookie($user_id);
    
    	do_action( 'wp_signon', $user_info->user_login );
    
    	bp_core_add_message( __( 'Your account is now active!', 'my-plugin-slug' ) );
    
    	buddypress()->activation_complete = true;
    }

    Dono12
    Participant

    @dono12

    Thanks for your prompt response and your help but that function did not achieve the goal I was looking for. I wanted the activation Key to come from Cymi User Extra Field. I found a solution from someone with a similar problem but it is a little too extreme for me. The result you get is a Cymi User Extra Field Key/URL, Looks like This(cimy_key=88fddcb568dcf2d6). It involved editing a core Buddypress file wp-content/plugins/buddypress/bp-core/bp-core-filters.php. Can you help with a function for my functions.php or bp-custom to achieve the same goal. If it’s not too much maybe generate the Cymi-Key in the Buddypress Email Template though not a priority. I’m fully aware that editing core files is not practical, especially being that you lose it during updates.

    https://buddypress.org/support/topic/activation-email-key-doesnt-work-i-may-have-the-fix/

    function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
    
    $activate_url = bp_get_activation_page() . "key=$key";
    $activate_url = esc_url($activate_url);
    $admin_email = get_site_option( 'admin_email' );
    
    if ( empty( $admin_email ) )
    $admin_email = 'support@' . $_SERVER;
    
    // Then it ends with, on line 255
    
    add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );

    roller24
    Participant

    @roller24

    David Im trying to alleviate the activation process, I tried your snippet in /wp-content/plugins/bp-custom.php

    I added a closing php tag because I didn’t see one, but something didn’t happen correctly.
    the registration page returns to registration page and no user is activated.

    Are we missing something? Do I need to put the code elsewhere?

    I also noticed in one file, I think it was signup that at the end of the file after submitting registration there was an if statement that asks if user activation required… send activation email..
    else
    echo your good go ahead and login..

    I was searching for the setting which makes activation required, but could not find it.
    There is a strange row in the bp data tables called “registration” with only a 0 as the data.
    Could this be changed to 1, I didn’t test it, but if you know.


    roller24
    Participant

    @roller24

    Those files were in the wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members
    file in question was registration.php


    roller24
    Participant

    @roller24

    ALTERNATELY, Can I put a view extended profile link on the Mangage signups page?

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar