Support » Plugin: WordPress Email Template Designer - WP HTML Mail » How to disable Template for certain emails

  • Resolved Marius Sonnentag

    (@about2press)


    Hi Hannes,

    first thank you for this super helpfull Plugin. I love it since i found it…

    Call me stupid but one Question i do have: How is the Syntax working to disable the template for one sepcific email?

    // return true if you want to use a template for current mail
    // return false if you want to leave the content of this email unchanged
    add_filter( 'haet_mail_use_template', 'customize_template_usage', 10, 2 );
    function customize_template_usage( $use_template, $mail ){
         $mail['to'] 'info@desiredemail.com'; // Does not work, what is here the expected syntax?
        // $mail['subject'] ...
        // $mail['message'] ...
        // $mail['headers'] ...
        // $mail['attachments'] ...
        return false;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hannes Etzelstorfer

    (@haet)

    Hey Marius,
    this is the short version:

    add_filter( 'haet_mail_use_template', 'customize_template_usage', 10, 2 );
    function customize_template_usage( $use_template, $mail ){
        if( $mail['to'] == 'info@desiredemail.com' )
            return false;
        return $use_template;
    }

    it just returns false if the email address matches otherwise it returns the original value.

    Thanks a lot to make this clear!

    Now it works like a charm!

    Thanks again for this super useful Plugin!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.