thank you. works perfectly.
I just had to put all three together
add_filter(‘bp_email_use_wp_mail’, ‘__return_true’);
add_filter( ‘wp_mail_content_type’, function( $content_type ) {
$content_type = ‘text/html’;
return $content_type;
} );
$must_use_wpmail = apply_filters( ‘bp_email_use_wp_mail’, $wp_html_emails || ! $is_default_wpmail );
if ( $must_use_wpmail ) {
$to = $email->get( ‘to’ );
return wp_mail(
array_shift( $to )->get_address(),
$email->get( ‘subject’, ‘replace-tokens’ ),
$email->get_template( ‘add-content’ )
);
}
add_filter( ‘wp_mail’, function( $array ) {
// Set conditions here.
$array[‘message’] = ‘Change this’;
return $array;
} );
DELETE THE FOLLOWING:
$must_use_wpmail = apply_filters( ‘bp_email_use_wp_mail’, $wp_html_emails || ! $is_default_wpmail );
if ( $must_use_wpmail ) {
$to = $email->get( ‘to’ );
return wp_mail(
array_shift( $to )->get_address(),
$email->get( ‘subject’, ‘replace-tokens’ ),
$email->get( ‘content_plaintext’, ‘replace-tokens’ )
);
}
LovePlove