Skip to:
Content
Pages
Categories
Search
Top
Bottom

User Activation link isn’t working for Admin

  • @ingram_av_98

    Participant

    Hi all,

    Thanks for any help in adavnce on this, I’ve been going round in circles for a few days now. I’m working on a localhost at the moment for testing, and both WordPress and BuddyPress are up to date (WP 4.3, I can’t quite remember the BP version).

    I want to have a manual activation process managed by the admin account, as its a private site.
    I’ve successfully forwarded the users activation email to the site admin email, and changed the subject and email message but the activation link doesn’f work for the admin account when logged in.

    To be clear, the activation url works for the test account it’s designed for or if the admin is logged out, but when the Admin user is logged-in the link just goes to the home page.

    I need the site admin to be able to click the link in the activation email but I can’t figure out what format the link needs to be in to work for a logged in admin.

    As an Admin is able to click the activation link in the dashboard, there must be a link that will work from an email, but I can’t find where this would be generated.

    Does anybody know how I could generate a link that admin can use from emails to activate a users account?

    Thanks to anyone that can shed some light on this.

Viewing 1 replies (of 1 total)
  • @ingram_av_98

    Participant

    Cool, awesome, wicked.
    As with everything BuddyPress over the last four months I figured it out myself.

    If anybody cares or is intrigued, I pulled out the “signup_id” from the wp_signups table and created a link with that, of the form:

    <?php
    	//== Setup variable for use in the activation email body.
    	$user = get_userdata( $user_id );
    
    	//== Get the signup_id for a user
    	global $wpdb;
    	$signup_id = $wpdb->get_var( "SELECT signup_id FROM wp_signups WHERE user_login = '" . $user->user_login . "' LIMIT 1" );
    
    	$user_path = "users.php?page=bp-signups&signup_id=" . $signup_id . "&action=activate";
    	$activate_user = admin_url( $user_path );
    ?>

    This link is a part of the filter for the activation email body, whilst the email itself was also filtered to be sent to the site admin instead of the user.

    If anybody is interested I’m happy to share the full solution which involved filtering the activation email recipient, email subject and email body, whilst giving the admin a link to activate the user and then sending a confirmation email to the user once they’ve been authorised.

Viewing 1 replies (of 1 total)
  • The topic ‘User Activation link isn’t working for Admin’ is closed to new replies.
Skip to toolbar