Created
March 27, 2019 14:25
-
-
Save haet/d3414f0a13916dd800b3e7f81f1532db to your computer and use it in GitHub Desktop.
disable email template for multiple subjects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'haet_mail_use_template', 'customize_template_usage', 10, 2 ); | |
function customize_template_usage( $use_template, $mail ){ | |
if( strpos( $mail['subject'], 'Subject 1' ) !== false | |
|| strpos( $mail['subject'], 'Subject 2' ) !== false | |
|| strpos( $mail['subject'], 'Subject 3' ) !== false ) | |
return false; | |
return $use_template; | |
} | |
// if you know the exact subject line you can also use == instead of strpos(): | |
add_filter( 'haet_mail_use_template', 'customize_template_usage', 10, 2 ); | |
function customize_template_usage( $use_template, $mail ){ | |
if( $mail['subject'] == 'Subject 1' | |
|| $mail['subject'] == 'Subject 2' | |
|| $mail['subject'] == 'Subject 3' ) | |
return false; | |
return $use_template; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment