If the filter bp_email_use_wp_mail
returns true, it’ll grab the “plain text” version of the email from BuddyPress, and send that to wp_mail()
. BuddyPress does not re-implement wp_mail()
.
BuddyPress will also fall back to use wp_mail()
if it detects that any other plugin has re-implemented that function (pretty common in email plugins), or if something’s configured WordPress to send HTML emails.
BuddyPress does not stop or block any other plugins’ emails from being sent, nor any emails sent by WordPress core (with a few exceptions for multisite-specific emails, but this has been implemented for about 6 or 7 years, so it’s not a new change).
I am just now testing this with WP Better Emails. Give me a minute.
BP emails enabled (the default) + WP Better Emails = email is sent in the WP Better Emails template.
BP emails disabled + WP Better Emails = email is sent in the WP Better Emails template.
I don’t know why you’re having problems with this — hopefully we’ll figure it out — but it seems like there’s something particular to your site or host that’s causing odds things to happen.
+1 : for me the new BP email bypass the WP Better Email template.
Hi @djpaul , Sorry for the delay! I’ve been testing up a storm with very inconsistent results, so its been difficult to narrow in on the issue.
I did forget to mention the site is Multisite and the host is WPEngine.
In general what I’m seeing is:
1.) 1-2 Email(s) send correctly.
2.) Then when altering configuration (i.e. adding add_filter( 'bp_email_use_wp_mail', '__return_true' );
to BP_Custom), and testing again, the emails output a combination of WP Better Email and the default template with various CSS Styles altering different parts of the email with each new email sent.
The results also depend on which email client I’m viewing the email notification through. Gmail’s iPhone App has had some of the most awkward results.
I also tried using bp-email-debug.php but did not receive any debug information to the admin email (Network activated and then activated on the single primary domain).
I’m going to keep looking into possible plugin and configuration issues but if you have any ideas you want tested or might help debug the issue, just let me know. Also, if you want me to send you email screen-shots or any other results from the testing just let me know and I can fire it to you via email.
Thanks Paul!
Formatting for all devices is tough.
Re debug, maybe try running this version as a plugin:
https://gist.github.com/shanebp/4270480b6afcb179ed77
Hi Shane, thanks for the update, but still no luck.
I’m adding the plugin to the mu-plugin folder and then sending a test message though BP with WP_Debug set to False. Are there any additional steps I’m missing?
2.) Then when altering configuration (i.e. adding add_filter( ‘bp_email_use_wp_mail’, ‘__return_true’ ); to BP_Custom), and testing again, the emails output a combination of WP Better Email and the default template with various CSS Styles altering different parts of the email with each new email sent.
BTW, this is exactly what I expect to happen. The content from the plain text version of the email from BuddyPress into the template provided by, in this case, WP Better Email.
If you’re saying extra CSS is getting involved, I strongly suspect you have some other plugin or theme component adding extra junk.
To update this thread, I’ve just added a fix for emails not sending for certain server configurations. See https://buddypress.org/support/topic/read-this-first-buddypress-2-5-master-list/ and https://buddypress.trac.wordpress.org/ticket/6947
I think this will help many people, but I would surprised if it fixed everything for everyone. Fingers crossed!
@djpaul thanks for the updates!
If you’re saying extra CSS is getting involved, I strongly suspect you have some other plugin or theme component adding extra junk.
I think you’re right. My suspicion is it’s some caching issue within the “Google Gmail App”, but I’m not 100% sure. Unfortunately this invalidates a bunch of my tests, but also means crossing your fingers may have helped 😀