Announcement

Collapse
No announcement yet.

if condition in eMail template

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • if condition in eMail template

    Hi there, is there a possibility to use an if Condition in a body Text of an eMail template? E.g. if field1 = "a" then text = "b"

  • #2
    In code editor:

    Code:
    <!-- {{#ifEqual field1 'a'}} -->
    b
    <!-- {{/ifEqual}} -->

    Comment


    • #3
      Great! Thank you!

      Comment


      • #4
        It doesn't work for me.
        I have in my code editor :
        <p>{Person.name}</p><p>{Call.contact.name}</p><p>{Call.contact.estusager}<br></p><p>Concerne {Call.name}&nbsp;<span style="color: rgb(51, 51, 51);">(
        <!-- {{#ifEqual Call.contact.estusager 1}} -->
        Usager du social
        <!-- {{/ifEqual}} -->
        )</span></p><p>Type : {Call.type} Niveau d'urgence :&nbsp;{Call.urgence}</p><p>Objet : {Call.name}<br></p><p>Description :&nbsp;{Call.description}&nbsp;</p>

        (Call.contact.estusager is a tinyInt(1))

        When Call.contact.estusager=0, "Usager du social" is written anyway.
        I tried <!-- {{#ifEqual Call.contact.estusager "1"}} --> <!-- {{#ifEqual Call.contact.estusager '1'}} --> <!-- {{#ifEqual Call.contact.estusager true}} --> but it doesn't work (it's working in a PDF template)

        What am I doing wrong ?

        Comment


        • #5

          We have the same problem. Handleable conditions do not work in normal email templates. Is there a workaround here? Click image for larger version

Name:	handlebars.PNG
Views:	598
Size:	79.5 KB
ID:	54270 Example:
          HTML Code:
              <!-- {{#if Lead.lastName}} --> <p> Dear Mr. {Lead.lastName}},</p> <!-- {{else}} --> <p>Dear Madam or Sir,</p> <!-- {{/if}} -->
          Attached Files

          Comment


          • espcrm
            espcrm commented
            Editing a comment
            Any luck? I probably want to add that if statement in future too.
        Working...
        X