• 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'] '[email protected]'; // 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)
  • 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'] == '[email protected]' )
            return false;
        return $use_template;
    }

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

    Thread Starter Marius Sonnentag

    (@about2press)

    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)
  • The topic ‘How to disable Template for certain emails’ is closed to new replies.