Email template functionality (if condition)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mark
    Senior Member
    • Dec 2019
    • 143

    Email template functionality (if condition)

    Hi,
    I'm having a problem with ifs not working when I try to send an email. The template picks up the values when they are just being written out, however, when I put it in an if statement it does not work. Therefore, I feel like I maybe am writing the statement incorrectly?

    <!-- {{#if Account.pVMSuma}} -->
    <table>
    <tbody>
    <tr><td><strong>Tax: {Account.taxesTemplate.name}</strong></td></tr>
    <tr><td>Amount: €{Account.pVMSuma}</td></tr>
    <tr><td> </td></tr>
    </tbody>
    </table>
    <!-- {{/if}} -->
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Hi Mark,

    Such a syntax is not supported in Email Templates. You are using original placeholders of email templates that do not support conditioning.

    You can use PDF template syntax since a recent version but it's tied to the email's Parent record.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Mark
      Senior Member
      • Dec 2019
      • 143

      #3
      Hi,

      Okay, I also tried using the placeholders from the PDF template syntax. However, it only worked when I was sending the email manually from the record (Account->certain record->activities->Compose email). But I need to be able to do this via workflow or flowchart, as it needs to be sent automatically when the record is created

      Comment

      Working...