Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • gentlemanhog
    Participant

    @gentlemanhog

    Hi,

    I did this, after some digging into the $bp object after the registration form is posted. Not tested properly in the wild yet, so you might want to double check before using this. Done via WordPress 3.5.1 and BuddyPress 1.7.2.

    
    add_filter('bp_core_signup_send_validation_email_message', 'custom_bp_change_activation_email_message');
    function custom_bp_change_activation_email_message($message) {
    	//	Get some globals
    	global $bp, $wpdb;
    
    	//	Get the slug of the activation page
    	$slug = $bp->pages->{"activate"}->slug;
    
    	//	Get username from the signup form just posted
    	$username = $bp->signup->username;
    
    	//	SQL query to get activation key for that username
    	$sql = 'select meta_value from wp_usermeta where meta_key="activation_key" and user_id in (select ID from wp_users where user_login="' . $username . '" and user_status=2)';
    
    	//	Getting the activation key from the database
    	$activation_key = $wpdb->get_var($sql);
    
    	//	Make activation URL
    	$url = sprintf("%s/%s/?key=%s", WP_HOME, $slug, $activation_key);
    
    	//	Custom message with activation key
    	$message = "Yayy! Thanks for signing up! Please confirm your account!\n\n$url";
    
    	return $message;
    }
    

    I’ve got this in a theme’s functions.php file, but not sure if that’s the right place for it. Would it be better in bp_custom.php?

    Ta,
    Alan.

Viewing 1 replies (of 1 total)
Skip to toolbar