The conflict with Ultimate Member plugin
-
Hi guys,
My name is Nikita and I’m the lead developer in the Ultimate Member team.
Our customer that also uses your plugins has encountered a problem with the formatting of emails.Emails containing HTML looked as raw HTML without Content-Type: text/html header. We use WP native
wp_mail()
function and pass theContent-Type:text/html
header to it.https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-mail.php#L448
It works fine with WP native
wp_mail()
.
But in the case of your Mailer class and rewrittenwp_mail()
, it seems that this line has a higher priority, andContent-Type:text/html
in the headers argument is ignored.This was confirmed by the fact that the workaround code works as it should:
function um_custom_wp_mail_content_type( $content_type ) { if ( UM()->options()->get( 'email_html' ) ) { $content_type = 'text/html'; } return $content_type; } function um_custom_before_email_notification_sending_set_data() { add_filter( 'wp_mail_content_type', 'um_custom_wp_mail_content_type', 10, 1 ); } add_action( 'um_before_email_notification_sending', 'um_custom_before_email_notification_sending_set_data' ); function um_custom_remove_before_email_notification_sending_set_data() { remove_filter( 'wp_mail_content_type', 'um_custom_wp_mail_content_type', 10 ); } add_action( 'um_after_email_notification_sending', 'um_custom_remove_before_email_notification_sending_set_data' );
Please add a fix that handles headers properly and uses the correct content-type from them.
Best Regards!
- The topic ‘The conflict with Ultimate Member plugin’ is closed to new replies.