• Resolved webitbtc

    (@webitbtc)


    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ìa

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Julian

    (@juliangk)

    Hello @webitbtc,

    the code seems to be correct. Are you using any other plugins that manipulate mail sending functions or e-mails?

    Best regards
    Julian

    • This reply was modified 3 years, 8 months ago by Julian.
    • This reply was modified 3 years, 8 months ago by Julian.
    Plugin Support Julian

    (@juliangk)

    Hello @webitbtc,

    did you manage to resolve your issue?

    Best regards
    Julian

    Plugin Support Julian

    (@juliangk)

    Hello @webitbtc,

    as you have not answered in quite some time, I suppose you have managed to fix the issue.

    If you have any further questions, you can open a new thread or also contact us trough [email protected].

    I will mark this thread as resolved.

    Best regards
    Julian

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.