Use IF Else condition within Process Email Template

Hi,

I tried to use below if else one-by-one in process email template html code but email comes with code and conditions are not working.

1. {if $check_service_c=="Yes"} sometext {/if}

2. <!--{if $check_service_c=="Yes"} sometext {/if}-->

3. <!--{{#if {::Leads::check_service_c::} == "Yes" }} sometext {{else}} sometext 2{{/if}}-->

4. {{#if {::Leads::check_service_c::} == "Yes" }} sometext {{else}} sometext 2{{/if}}

My requirement is, If checkbox is checked than show sometext

Any help will be highly appreciable

Regards

Parents
  • Hi Muhammad,

    If Francesca's suggestion doesn't work, I found the Smarty Documentation page for if/else statements. In the comments it was noted that spaces are required before and after the "==". I also noticed that all of the examples use single quotes for string comparisons, though I'm not certain whether that matters. You might try:

    {if $check_service_c == 'Yes'}sometext{/if}

    I hope that helps!

    -Alan

Reply
  • Hi Muhammad,

    If Francesca's suggestion doesn't work, I found the Smarty Documentation page for if/else statements. In the comments it was noted that spaces are required before and after the "==". I also noticed that all of the examples use single quotes for string comparisons, though I'm not certain whether that matters. You might try:

    {if $check_service_c == 'Yes'}sometext{/if}

    I hope that helps!

    -Alan

Children
  • Any suggestions  I want to use if statement in my template. Please help me. When i try to use  at above code, doesn't work.

  • Has anybody found an answer to this?

    IF statements seem to work in Smarty / PDF Manager, but not in Process Email Template. 

    Also, the HTML editor keeps reformatting my code, for instance moving my if statement embedded in a table (eg; to display a row or not depending on a field value)

    Damien Pochon

    CRM & Digital consultant @ ITS4U Group