Email greeting config crashes on some smarty `if` statements if quotes are involved
I don't think this is recent, but in message templates I remember there was some handling so that you could do e.g. {if '{token.something}' == ''}aaa{else}bbb{/if}
, and if {token.something}
's value contained apostrophes it would still work. I haven't checked if that's still working but if you do the same in an email greeting it will crash. Example:
- Create a new contact with first name
D'Andre
. - Down in communication prefs choose customized for the email greeting and put
Dear {if '{contact.first_name}' == ''}Friend{else}{contact.first_name}{/if}
. - When you save it crashes because the apostrophe confuses it.
- It's not related to choosing "customized". It happens if this is your normal config at admin - communications - email greetings.
- It also happens if you try double-quotes and then the name contains a double-quote.
I can work around it with Dear {if {contact.first_name|boolean}}{contact.first_name}{else}Friend{/if}
, but if I wanted to compare to an actual value that wouldn't help.