When the content of the Email Greeting or the Postal Greeting field is getting too long, CiviCRM is no longer able to edit it through the GUI, what happened since I have activated Smarty and inserted large expressions.
I want to have a standard greeting that works for every gender, language and style.
This was working:
{capture assign=language}{contact.preferred_language}{/capture}{capture assign=prefix}{contact.individual_prefix}{/capture}{capture assign=style}{contact.communication_style}{/capture}
{if $style == 'Formal'} {if $language == 'fr_FR'}Cher{elseif $language == 'nl_NL'}Geachte{else}Dear{/if} {$prefix|replace:'De heer':'heer'|replace:'De heren':'heren'|lower} {contact.last_name}{else}{if $language == 'fr_FR'}Bonjour{elseif $language == 'nl_NL'}Dag{else}Dear{/if} {contact.first_name}{/if}
but the expression is getting too long when I try to add a test about the gender. As a work around, I decided to put this expression inside a file to be included by Smarty with this expression:
{include file='/usr/share/drupal/sites/default/files/my-greeting.tpl'}
but this doesn't work: nothing is included. The file /usr/share/drupal/sites/default/files/my-greeting.tpl
has the correct ownership and permissions.
I would like to understand what I am doing wrong, and if it is possible to use this approach without opening a hole in the security of the system.