Fixing BuddyPress Activation Emails

In this tutorial, we’ll guide you through resolving the common issue of BuddyPress users not receiving activation emails through Easy WP SMTP.

Understanding the BuddyPress Activation Email

The BuddyPress activation email is the email that a new user receives when they sign up on your site. It includes a link they are required to click in order to finalize their registration.

If this email isn’t delivered, the new user is unable to complete their registration and start using their account.

Installing Easy WP SMTP

Easy WP SMTP ensures that WordPress emails are sent and delivered efficiently. By using trusted third-party providers, it greatly boosts the chance of your emails reaching the recipient’s inbox and not in the spam.

Once you’ve installed Easy WP SMTP and completed the setup wizard, you can proceed with the next step.

Adding Code Snippet to Fix BuddyPress Emails

WordPress usually uses the ‘wp_mail()’ function for password reset emails, but BuddyPress activation emails don’t always use this, which can lead to problems.

We’ll fix this by adding a simple code snippet that channels BuddyPress emails through Easy WP SMTP. This change also converts emails to HTML format, so you can see if they’re opened or clicked if you’ve enabled email logging.

Note: For help with adding snippets to your site, please see WPBeginner’s guide on adding code snippets using the WPCode plugin.

We recommend that you copy and paste the required snippet below into a new WPCode snippet. WPCode makes it easy and safe to run code snippets on your site.

// Set BP to use wp_mail
add_filter( 'bp_email_use_wp_mail', '__return_true' );
// Set messages to HTML for BP sent emails.
add_filter( 'wp_mail_content_type', function( $default ) {
	if ( did_action( 'bp_send_email' ) ) {
		return 'text/html';
	}
	return $default;
} );
// Use HTML template
add_filter(
	'bp_email_get_content_plaintext',
	function( $content, $property, $transform, $bp_email ) {
		if ( ! did_action( 'bp_send_email' ) ) {
			return $content;
		}
		return $bp_email->get_template( 'add-content' );
	},
	10,
	4
);

Now all your BuddyPress emails are being sent through Easy WP SMTP in HTML format.

That’s it! Now you know how to fix BuddyPress activation emails and ensure they’re delivered reliably with Easy WP SMTP.