• Resolved Alexanderine

    (@alexanderine)


    Hello,
    I’ve been using this plugin and it’s awesome very capable, I recommend it to all my clients.

    I was able to bypass a specific email subject and use my own template, but what if there are more than one subject how should the code look like.

    My current code
    add_filter( ‘haet_mail_use_template’, ‘customize_template_usage’, 10, 2 );
    function customize_template_usage( $use_template, $mail ){
    if( $mail[‘subject’] == ‘New customer message’ )
    return false;
    return $use_template;
    }

    And it works flawlessly, But I’m unable to declare this function twice for another email subject, Like what if I have 7 more subjects how would that play out?

    Thank you

    • This topic was modified 2 years, 2 months ago by Alexanderine.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Julian

    (@juliangk)

    Hello @alexanderine,

    you just need an “OR” statement within the “if” statement for each subject, such as:

    if( $mail[‘subject’] == ‘New customer message’ || $mail[‘subject’] == ‘Subject 2’ || $mail[‘subject’] == ‘Subject 3’ )
           return false;
    return $use_template;
    }

    Best regards
    Julian

    Thread Starter Alexanderine

    (@alexanderine)

    Thank you it works 🙂

    Plugin Support Julian

    (@juliangk)

    @alexanderine

    Happy to help!
    Let us know if you need anything else.

    Best regards
    Julian

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multiple Emails Subject bypass’ is closed to new replies.