BuddyDev

Search

[Resolved] I want the registration to complete after clicking the registration email link

  • Participant
    Level: Enlightened
    Posts: 46
    Kristian Yngve on #21050

    Hi Brajesh,

    I want to avoid needing to activate an activation key (having to press the [activate] button) after clicking the registration email link.

    For example: I want the email link to direct you to a page with a customized text of: “registration complete, you are now able to login in to the site.”

    Is it possible to have the site instructed to already activate the activation key the moment the registration email link is clicked and directed you to the site?

    Many thanks for your time in looking at this,

    Kristian

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #21071

    Hi Kristian,
    Yes, This is easily doable.

    You may use the following code

    
    
    /**
     * Activate and redirect.
     */
    function buddydev_auto_activate_redirect() {
    	$key = bp_get_current_activation_key();
    	if ( $key ) {
    		bp_core_activate_signup( $key );
    		bp_core_redirect( site_url( '/about/' ) );
    	}
    
    }
    
    add_action( 'bp_template_redirect', 'buddydev_auto_activate_redirect' );
    

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 46
    Kristian Yngve on #21076

    Thank you so much Brajesh! 🙂

    This was perfect!

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #21082

    You are welcome 🙂

The topic ‘ [Resolved] I want the registration to complete after clicking the registration email link’ is closed to new replies.

This topic is: resolved