Nice! 8.0.0 will include a BP Email to welcome your new community members

If registrations to your site are open, your new members will now receive a warm welcome email once they activated their account.

Screen capture of the default Welcome email

By default its content is very simple, it contains:

  • a link to the user’s profile page,
  • a link to reset their password.

But as you probably know BP Emails are customizable emails, so you can edit this content and make it very unique to your community. Let’s remind ourselves how to achieve this.

First, from the Emails menu of your WordPress Dashboard, look for the [{{{site.name}}}] Welcome! BP Email, mouse over its title and click on the “Edit” link as shown above.

Then edit the content of your email with the text of your choice. I chose to use one containing a link using a custom email token: <a href="{{{groups.url}}}">. In order to replace the groups.url token with the Groups directory permalink before the email is sent, I need to make sure this token is defined using the bp_send_welcome_email_tokens filter. The code below shows you an example of how you can do it.

/**
 * Add the Groups directory URL to the welcome email's tokens.
 *
 * @param array $tokens  An associative array of email tokens.
 * @param int   $user_id The ID of the user who activated their account.
 * @return array An associative array of email tokens.
 */
function bp_custom_code_add_groups_url_to_welcome_email_tokens( $tokens = array(), $user_id = 0 ) {
	// I known, as the Admin of the site, the Groups component is active, let's include a link to its directory.
	$tokens['groups.url'] = bp_get_groups_directory_permalink();

	return $tokens;
}
add_filter( 'bp_send_welcome_email_tokens', 'bp_custom_code_add_groups_url_to_welcome_email_tokens', 10, 2 );

And.. It’s working 🙌 See the screen capture below 😇

Tada!

#8-0-0, #bp-email, #welcome