2

I've done a custom email greetings that have this structure:

{capture assign=l}{contact.preferred_language}{/capture}
{capture assign=g}{contact.gender}{/capture}
{if $l=="en_US"}Dear
{elseif $l=="et_EE"}Kallis
{elseif $g=="Female"}Дорогая
{else}Дорогой{/if}

It works fine in the summary tab of the contact profile. But token {contact.email_greeting} doesn't work when I am sending emails. There is nothing instead of email greeting.

Do you have any suggestions how can I fix this problem?

Thanks in advance.

1 Answer 1

4

Any chance you don't have smarty enabled for civiMail so your capture-assigns and ifs aren't working in the mail?

Try checking your civicrm.settings.php file and look for the line

define( 'CIVICRM_MAIL_SMARTY', 1 );

as per https://backofficethinking.com/blog/tip-how-personalize-emails-civicrm. If you don't find it, or if it's set to 0, you'll need to add/change it for this to work.

6
  • Thank you for your answer. I've changed 0 to 1 in this file, but token still doesnt work.If I put my code right in the body of the message I have HTTP error 500.If I put my code into the email greetings and then insert {contact.email_greeting} into the body of the message I have blank space instead of it in the email.
    – Irina
    Commented Mar 9, 2017 at 10:22
  • After some tests I figured out that token with this code works correctly via simple mails. But when I'm using schedule reminder the token doesn't appear in the message (only this one with the smarty inside token).
    – Irina
    Commented Mar 9, 2017 at 13:22
  • Can you confirm your civiCRM version? Commented Mar 9, 2017 at 16:12
  • CiviCRM version 4.7.14
    – Irina
    Commented Mar 10, 2017 at 7:39
  • 1
    Thanks - since it's working via simple mails now - you might be experiencing a bug. Does {contact.email_greeting} appear in your scheduled reminder even when you're not using the customized greeting? Sounds like it could be issues.civicrm.org/jira/browse/CRM-19757 Commented Mar 10, 2017 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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