Disable WP-HTML-Mail template for specific emails

WP HTML Mail is a free WordPress plugin to customize all your outgoing emails. In most cases the plugin just wraps a container around existing emails and applies some nice styling.

For some plugins like WooCommerce and Easy Digital Downloads it offers advanced styling features.

But many other plugins already use their own template system. WP HTML Mail can’t detect these other templates, but it has a filter to manually disable the template for some emails.

Just add one of the functions below to your themes functions.php

Disable Email Template by subject keyword

add_filter( 'haet_mail_use_template', 'disable_email_template_by_subject', 10, 2 );
function disable_email_template_by_subject( $use_template, $email ){
    if( stripos( $email['subject'], 'MY KEYWORD' ) !== false )
      $use_template = false;
  return $use_template;

Disable Template if message contains a specific string

add_filter( 'haet_mail_use_template', 'disable_email_template_by_message', 10, 2 );
function disable_email_template_by_message( $use_template, $email ){
 if( stripos( $email['message'], 'MY KEYWORD' ) !== false )
      $use_template = false;
  return $use_template;

You can change the functions to use receiver, attachment or anything else to detect your email.