Hi @contemplate – The plugin uses bp_send_email()
, the function used by all BuddyPress emails. Are you seeing the same issue with BP’s emails? (Notification of new private messages, of friend requests, of activity mentions, and so on.)
By default, bp_send_email()
does *not* use wp_mail()
; it instead loads a slightly customized version of PHPMailer
. See https://github.com/buddypress/BuddyPress/blob/90d7a4cee7f68a175a4279ecabe2853dd1e48dfe/src/bp-core/bp-core-functions.php#L3123.
However, it doesn’t look like wp-mail-smtp requires the use of wp_mail()
. Instead, it hooks to phpmailer_init
, which *is* defined by BP’s email system. https://github.com/awesomemotive/WP-Mail-SMTP/blob/89b1d1f63b0c7c93a480c70b80015f26a6742e70/wp_mail_smtp.php#L854
So I’m not quite sure what might be happening. It might help narrow things down if you can identify whether the issue is limited to BPGES emails, or to all BP emails, or to all emails in general (such as password resets).
ok thanks for the info @boonebgorges. It does appear WP Mail SMPT requires wp_mail()
I got this working with the help of this thread:
https://buddypress.org/support/topic/using-wp_mail-and-emails/
in my bp-custom.php I have:
// SEND BP EMAILS THROUGH SMTP
add_filter('bp_email_use_wp_mail', '__return_true');
add_filter( 'wp_mail_content_type', function( $content_type ) {
$content_type = 'text/html';
return $content_type;
} );
and then in I had to edit the bp_send_email function in file /buddypress/bp-core/bp-core-functions.php and change this line:
$email->get( 'content_plaintext', 'replace-tokens' )
to this:
$email->get_template( 'add-content' )
Now Buddypress emails are authenticating through SMTP
Thanks for circling back, @contemplate. Sounds like this is not a problem specific to BPGES.