Magento – Check condition in the email templates in magento

email-templatesmagento-1.9

I had passed custom variable to invoice email template and i checked by calling that variable in the invoice template with following code

{{var isused}} and the values is printing in the email template.

Now actually what i want to do is i want to check the variable and accordingly if it is true i need to print the text in the email template.

so i had used following code in the text area in the email template

{{if isused == 'yes'}}
    <tr>
        <td>Hello I m in the if</td>
    </tr>
{{/if}}

now i isused variable value is yes i am sure but the condition is not getting true and not printing the text

Please Help Me

Best Answer

Why dont you have a condition in the php file , Where you check the condition decide the string according to the condition and call the variable in the email templates which contains a string and print the string in the Email Templates .

It will be a better option.

Related Topic