-
-
Save imath/4faef242ae104c65ddb9ec711ea37189 to your computer and use it in GitHub Desktop.
Forces the BP email content to be HTML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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