Support » Plugin: Email Template Designer - WP HTML Mail » haet_mail_use_template filter no longer working

  • Resolved altimac

    (@altimac)


    Hi, we’ve been using Email Template Designer – WP HTML Mail for a while now, and for some reason, the code I’ve used to exclude our FluentCRM emails from using the template is no longer working. This is what we have been using:

    // Prevent WP HTML Mail plugin from modifying FluentCRM emails
    // As long as <!– Sender: FluentCRM –> is in the body of the email template
    add_filter( ‘haet_mail_use_template’, ‘customize_template_usage’, 10, 2 );
    function customize_template_usage( $use_template, $mail ) {
    $string = $mail[‘message’];
    if( str_contains($string, ‘Sender: FluentCRM’) );
    return false;
    return $use_template;
    }

    and I just can’t get it to work. I’ve tried alternate strings in the message and using something that’s actually in the message body but not commented out, and it still won’t exclude these emails. I rolled back to 3.2.2 and then 3.2.1 but that did not help either. Any idea why this might not be working?

    Also, I do see that “96” in my emails as the other poster noted a few weeks ago.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Hannes Etzelstorfer

    (@haet)

    Hey @altimac
    try to remove the “;” after the if statement
    best regards, Hannes

    Thread Starter altimac

    (@altimac)

    Hi, Hannes. Thank you for responding so quickly, tried removing the ; but still no joy. Honestly, I can’t understand why this would NOT work, since it was fine up until recently.

    Plugin Support Julian

    (@juliangk)

    Hello @altimac

    can you try this code:

    add_filter( 'haet_mail_use_template', 'customize_template_usage', 10, 2 );
    
    function customize_template_usage( $use_template, $mail ) {
    	$string = $mail['message'];
    	if( str_contains($string, ‘Sender: FluentCRM’) ){
    		return false;
    	}
    	return $use_template;
    }

    Best regards
    Julian

    Thread Starter altimac

    (@altimac)

    Thank you SO MUCH, Julian. That did the trick! Really appreciate your help and that your plugin even has this option for excluding certain messages.

    Plugin Support Julian

    (@juliangk)

    Hello @altimac,

    I am happy to help, please let us know if you have any further issues.

    Best regards
    Julian

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘haet_mail_use_template filter no longer working’ is closed to new replies.