Skip to content

Instantly share code, notes, and snippets.

@imath imath/bp-custom.php Secret
Last active Jul 1, 2019

Embed
What would you like to do?
Forces the BP email content to be HTML
<?php
/**
* @see https://buddypress.trac.wordpress.org/ticket/8104
* @see https://buddypress.trac.wordpress.org/ticket/8108
* @see https://buddypress.org/support/topic/buddypress-email-notification-ignoring-smtp-server-settings/
*/
function shawfactor_use_html_wp_mail() {
return 'text/html';
}
/**
* If you're using a plugin to send emails using wp_mail, it may
* already force HTML.
*/
add_filter( 'wp_mail_content_type', 'shawfactor_use_html_wp_mail' );
function shawfactor_get_bp_email_content_plaintext( $content = '', $property = 'content_plaintext', $transform = 'replace-tokens', BP_Email $bp_email ) {
// Make sure we're about to send an email.
if ( ! did_action( 'bp_send_email' ) ) {
return $content;
}
return $bp_email->get_template( 'add-content' );
}
add_filter( 'bp_email_get_content_plaintext', 'shawfactor_get_bp_email_content_plaintext', 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.