We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53685
    • 1 Posts
    Hi everyone!

    I have a general template for an e-mail that has some conditions inside using the If snippet.

    So what we do is to get everything we need for an email, load the template and send it. The thing is that, for some emails the template is processed perfectly and not for others, where the snippets called appears like plain text

    <html>
    
      <body style="background-color: #eeeeee;">
    
      <table style="width:100%; background-color: #eeeeee;padding-top: 20px;padding-bottom: 20px; padding-left: 10px; padding-right: 10px; font-family: helvetica,arial,sans-serif;line-height: 1.5em;" cellpadding="0" cellspacing="0">
        <tr>
          <td>
              <table cellpadding="0" cellspacing="0" style="width:100%; max-width: 600px; background: #ffffff; margin: 0 auto; padding-top: 20px;padding-bottom: 20px;padding-left: 20px;padding-right: 20px;">
                  <tr>
                        <td>
                            <p>[[%ldemail.dear? &namespace=`myApp` &topic=`email`]] [[+emailName]]</p>
    
                            <p>[[+emailMessage]]</p>
    
                            [[!If? &subject=`[[+confirmUrl]]` &operator=`!empty` &then=`<p><a href="[[+confirmUrl]]" align="center" class="float-center btn" style="background-color: #47ce87;color: #ffffff;text-align: center;width: 100%;padding-top:12px;padding-bottom: 12px; border-radius: 3px;display: block; text-decoration: none; font-weight: 500; font-size: 20px;">[[%ldemail.click_here_activate? &namespace=`myApp` &topic=`email`]]</a></p>` ]]
    
                            [[!If? &subject=`[[+emailMessageFooter]]` &operator=`!empty` &then=`[[+emailMessageFooter]]` ]]                        
    
                            [[%ldemail.signature? &namespace=`myApp` &topic=`email`]]
    
                       </td>
                  </tr>
              </table>
    
          </td>
        </tr>
      </table>
      </body>
    </html>
    


    The variables like [[+emailMessage]] are being processed perfectly, but the If are not. Any idea why?

    Thanks!
      • 4172
      • 5,888 Posts
      depending where and how you are calling that chunk, you might need to call the If - snippet not with uncached tags.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!