BuddyDev

Search

[Resolved] Append extra params to member activation link send via email

  • Participant
    Level: Initiated
    Posts: 2
    Sarwar Alam on #49412

    Hello,

    I need to pass few extra parameters to the member activation link sent via email in buddypress; how can do that?
    Spent a lot of time with no results yet. Any sort of help would be highly appreciated. Thanks.

  • Participant
    Level: Initiated
    Posts: 2
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #49418

    Hello Sarwar,

    Welcome to the BuddyDev Forums. You can try the following code:

    
    add_filter( 'bp_after_send_email_parse_args', function ( $args ) {
    
    	if ( isset( $args['tokens'] ) && isset( $args['tokens']['activate.url'] ) ) {
    		$args['tokens']['activate.url'] = add_query_arg(
    			array(
    				'key1' => 'key1',
    				'key2' => 'key1213',
    			),
    			$args['tokens']['activate.url']
    		);
    	}
    
    	return $args;
    } );
    
    

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 2
    Sarwar Alam on #49421

    Ah! Thank you so much Ravi. You saved me! This is exactly what I was looking for.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #49426

    Hello Sarwar,

    Thank you for the acknowledgement. I am glad to help you.

    Regards
    Ravi

The topic ‘ [Resolved] Append extra params to member activation link send via email’ is closed to new replies.

This topic is: resolved