Answers.Body: <p>Any chance you don't have smarty enabled for civiMail so your capture-assigns and ifs aren't working in the mail?</p>
  
  <p>Try checking your civicrm.settings.php file and look for the line </p>
  
  <pre><code>define( 'CIVICRM_MAIL_SMARTY', 1 );
  </code></pre>
  
  <p>as per <a href="https://backofficethinking.com/blog/tip-how-personalize-emails-civicrm" rel="noreferrer">https://backofficethinking.com/blog/tip-how-personalize-emails-civicrm</a>. If you don't find it, or if it's set to 0, you'll need to add/change it for this to work.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-09T10:22:59.040Z
Answers.Text: 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.
Answers.UserDisplayName: Irina
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-09T13:22:32.013Z
Answers.Text: 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).
Answers.UserDisplayName: Irina
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-09T16:12:56.490Z
Answers.Text: Can you confirm your civiCRM version?
Answers.UserDisplayName: Eli Lisseck
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-10T07:39:15.360Z
Answers.Text: CiviCRM version 4.7.14
Answers.UserDisplayName: Irina
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-10T15:19:56.590Z
Answers.Text: 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 https://issues.civicrm.org/jira/browse/CRM-19757
Answers.UserDisplayName: Eli Lisseck
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-15T11:07:34.210Z
Answers.Text: Thanks. No, this token doesn't appear. Gonna update civicrm.
Answers.UserDisplayName: Irina
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-06T13:27:25.233Z
Answers.LastActivityDate: 2017-03-06T13:27:25.233Z
Answers.UserDisplayName: Eli Lisseck
Body: <p>I've done a custom email greetings that have this structure:</p>
  
  <pre>{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}</pre>
  
  <p>It works fine in the summary tab of the contact profile. But token <code>{contact.email_greeting}</code> doesn't work when I am sending emails. There is nothing instead of email greeting. </p>
  
  <p>Do you have any suggestions how can I fix this problem?</p>
  
  <p>Thanks in advance.</p>
  
Tags: <wordpress><email><tokens><smarty>
Title: Custom Email Greeting token doesn't work
ThreadText: # Custom Email Greeting token doesn't work
  
  (Asked by: username_0 on 2017-03-06)
  
  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.
  
  **Tags:** wordpress, email, tokens, smarty
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-03-06. Score: 4 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_0**: 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.  
  > **username_0**: 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).  
  > **username_1**: Can you confirm your civiCRM version?  
  > **username_0**: CiviCRM version 4.7.14  
  > **username_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 https://issues.civicrm.org/jira/browse/CRM-19757  
  > **username_0**: Thanks. No, this token doesn't appear. Gonna update civicrm.  
  
  ---
  
  