Code Snippet is disabeling template for all mails instead of defined “subject”
-
Hallo Hannes @huet
So I’m using your snippet to disable the template for specific words in the subject string:
/* disable email template for multiple subjects */ add_filter( 'haet_mail_use_template', 'customize_template_usage', 10, 2 ); function customize_template_usage( $use_template, $mail ){ if( strpos( $mail['subject'], 'order' ) !== false || strpos( $mail['subject'], 'Bestellung' ) !== false || strpos( $mail['subject'], 'Password' ) !== false || strpos( $mail['subject'], 'Passwort' ) !== false || strpos( $mail['subject'], 'created' ) !== false || strpos( $mail['subject'], 'erstellt' ) !== false || strpos( $mail['subject'], 'Dank' ) !== false¨ || strpos( $mail['subject'], 'Thank' ) !== false ) return false; return $use_template; }
But: with this code in my child themes function.php it disables the template for all mails, even the Test-Email send from your plugin.
How come? Did I miss something?
It would be really kind if you could help me out.
Thank you!
ElìaThe page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Code Snippet is disabeling template for all mails instead of defined “subject”’ is closed to new replies.