-
-
Save dwenaus/8762785 to your computer and use it in GitHub Desktop.
// if the WP_Better_Emails plugin is installed, stop BuddyPress Group Email Subscription plugin from wrapping digests with <html><body>$message</body></html> | |
function my_dont_wrap_digests_with_html_twice( $message, $message_pre_html_wrap ) { | |
if ( class_exists( 'WP_Better_Emails' ) ) { | |
$message = $message_pre_html_wrap; | |
} | |
return $message; | |
} | |
add_filter( 'ass_digest_message_html', 'my_dont_wrap_digests_with_html_twice', 10, 2 ); |
i've really tried to disabled the html formating for digest mail but it didn't work, even if i comment this line:
$message = apply_filters( 'ass_digest_message_html', "{$message}", $message );
i still get the html formating which doesn't work with the WP_Better_Email plugin... please help!
hmmm i've placed the code in my bp-custom.php but it doesn't change anything. Thanks Dwenaus but i'll have to try something else!
Here's a wordpress forum topic about it on the WP Better Emails Plugin support : https://wordpress.org/support/topic/also-customize-the-emails-of-buddypress
Hi, i have found a sort of work out to disable html formating for Wp Better Email Digest, please help me to write the function !
boonebgorges/buddypress-group-email-subscription#65
Is this function correct? (i've placed it in my bp-custom.php file)
function my_digests_in_plain_text( $headers ) {
if ( class_exists( 'WP_Better_Emails' ) ) {
$headers = array( 'Content-type: text/plain' );
}
return $headers;
}
add_filter( 'ass_send_multipart_email', 'my_digests_in_plain_text', 10, 2 );
That looks pretty nice and simple, but do i have to modify something in p-activity-subscription-digest.php?
I've been testing this code but it didn't change anything for my weekly and monthly digest ;-(