Tagged: HTML email, plain text, WP HTML Mail
It seems that BP Emails don’t read as HTML, but instead send as plain text, even though on the actual email editor, HTML works. http://prntscr.com/o2ouhh
Once it is sent: http://prntscr.com/o2oulz
I initially thought it was due to a plugin conflict with WP HTML Mail but I’ve deactivated it and the problem still exists. I looked around the forums and found the following code, which enabled HTML again: http://prntscr.com/o2ox64
/** * Provide an HTML template for all your BuddyPress emails * BuddyPress 2.5 introduced a new stylised HTML email system. * By default the HTML system doesn't work if a 3rd party transactional email plugin is active * (e.g. wpMandrill or SendGrid), and reverts to sending plain text emails. * * This function allows the stylised BuddyPress HTML emails to be sent using some 3rd party plugin. * It does this by sending the email through wp_mail() rather than directly with PHPMailer. * * @author Mecanographik * * inspiration : * @link https://github.com/21applications/bp-wpmandrill * */ add_action( 'init', 'my_prefix_bp_wp_mail_html_filters' ); function my_prefix_bp_wp_mail_html_filters() { add_filter( 'bp_email_use_wp_mail', function( $bool ) { return false; }, 10, 1 ); }
However, it as the code says, it uses BP HTML format instead.
Is there someway to make it compatible with WP HTML Mail?
I found this: https://buddypress.org/support/topic/solutions-for-html-email-text/ but I am hesitatent to make changes to the bp core files.Thank you in advance for your help!
Hi Mocha,
Thank you for the question.1. BuddyPress supports HTML email out of the box. If it was not working, Most probably a conflict with 3rd party plugin. I have seen issues when using 3rd party smtp plugins.
2. The above code does not do much. It re enables the html email from BuddyPress(which should be the default case). The settings was being overridden by some code or 3rd party plugin and I don’t see any harm in using the above code.
The only thing it does is instead of using wp_mail() it uses bp_send_email() which uses a custom extend version of PHP Mailer.
The problem with this approach is most of the smtp plugin’s won’t be able to deliver it(the filters are different).
Hope that clarifies
Regards
BrajeshBrajesh,
Yes it clarified things for me. Someone suggested changing the core files to this:
$email->get( ‘content_plaintext’, ‘replace-tokens’ )
$email->get( ‘content_html’, ‘replace-tokens’ )
Do you recommend this? And if not, do you know of any good 3rd party smtp plugins that won’t conflict with BP?
Thanks!
`Hi Mocha,
Thank you.I am not sure which smtp plugin supports BuddyPress. If you have a choice, Please let me know, we can most probably make any of them compatible with BuddyPress.
Regards
BrajeshBrajesh,
Would it be possible to make it compatible with WP HTML Mail plugin?
https://wordpress.org/plugins/wp-html-mail/Thank you so much!
Hi Mocha,
Thank you for the link.It is not a smtp plugin but an html email designer.
I will ask one of my team members to look at it and get back to you.
Thank you
BrajeshHi Mocha,
It seems the plugin you referrred have already added BuddyPress Compatibility.https://wordpress.org/support/topic/buddypress-issue-8/#topic-11681720-replies
Regards
BrajeshHey, I just found this topic… I’m the developer of WP HTML Mail. We created a free BuddyPress add-on a few months ago: https://wordpress.org/plugins/wp-html-mail-buddypress/
best regards, HannesHi Hannes,
Welcome to BuddyDev.Thank you for developing the BuddyPress addon and taking time to sharing with us all.
Regards
Brajesh
You must be logged in to reply to this topic.