I try to send single emails (Contacts > New Email) using a message template containing smarty conditional instructions in the html part of the message and in the text part of it.

HTML format:

<p>{capture assign=lang}{contact.preferred_language}{/capture}</p>

<p>{contact.email_greeting} ({$lang}),</p>

<p>{if $lang == 'fr_FR'}OK{/fi}</p>

Plain-Text Format

{capture assign=lang}{contact.preferred_language}{/capture}
{contact.email_greeting} ({$lang}),
{if $lang == 'fr_FR'}OK{/fi}

For avoiding problems with the quotes in the smarty instructions being changed into entities, I disabled the CKeditor and I am editing the HTML part of the message in a textarea.

The ´{capture}` instructions work as expected.

But whatever I try to do, every time I include the {if} instruction in the HTML part as in the plain text part, that part of the mail is not sent. If I remove the conditional instruction, the other instructions work.

I don't understand why this simple construction is not working.


{/fi} isn't the right syntax to close the if, use {/if}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.