Answers.Body: <p>Gender wasn't properly define and @Fabian inspired me this little improvement:</p>
  <p><code>{if &quot;{contact.gender}&quot;==&quot;Femme&quot;}Chère{ }{contact.first_name}{elseif &quot;{contact.gender}&quot;==&quot;Homme&quot;}Cher{ }{contact.first_name}{else}{contact.first_name}{/if}</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-10T17:34:45.527Z
Answers.LastActivityDate: 2021-06-10T17:34:45.527Z
Answers.UserDisplayName: Guillaume Sorel
Body: <p>Is there any reason why a custom greeting using smarty wouldn't work anymore on recent versions of CiviCRM:</p>
  <p><code>{if &quot;{contact.gender}&quot;==&quot;Femme&quot;}Chère{ }{contact.first_name}{elseif &quot;{contact.gender}&quot;==&quot;Homme&quot;}Cher{ }{contact.first_name}{/if}</code></p>
  <p>was working smoothly until recently on both WP and Drupal?</p>
  <p>I don't understand what happened :-/</p>
  <p>Of course Smarty is enabled :</p>
  <pre><code>if (!defined('CIVICRM_MAIL_SMARTY')) {   define( 'CIVICRM_MAIL_SMARTY', 1 ); }
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-09T13:01:19.890Z
Comments.Text: I just tested it and it still works for us on 5.35.2 Drupal 7.x. Did you maybe change the values for {contact.gender}? Maybe you also want to  include an else option such as this: {if "{contact.gender}"=="Femme"}Chère{ }{contact.first_name}{elseif "{contact.gender}"=="Homme"}Cher{ }{contact.first_name}{else}Hi there{/if}
Comments.UserDisplayName: Fabian
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-10T13:12:57.477Z
Comments.Text: thanks Fabian, I'll try this way.
Comments.UserDisplayName: Guillaume Sorel
Tags: <smarty>
Title: Smarty for greeting not functioning anymore on civicrm > 5.35
ThreadText: # Smarty for greeting not functioning anymore on civicrm > 5.35
  
  (Asked by: username_0 on 2021-06-09)
  
  Is there any reason why a custom greeting using smarty wouldn't work anymore on recent versions of CiviCRM:
  
  `{if "{contact.gender}"=="Femme"}Chère{ }{contact.first_name}{elseif "{contact.gender}"=="Homme"}Cher{ }{contact.first_name}{/if}`
  
  was working smoothly until recently on both WP and Drupal?
  
  I don't understand what happened :-/
  
  Of course Smarty is enabled :
  
  ```
  if (!defined('CIVICRM_MAIL_SMARTY')) {   define( 'CIVICRM_MAIL_SMARTY', 1 ); }
  
  ```
  
  **Tags:** smarty
  
  > **Comments:**
  > **username_1**: I just tested it and it still works for us on 5.35.2 Drupal 7.x. Did you maybe change the values for {contact.gender}? Maybe you also want to  include an else option such as this: {if "{contact.gender}"=="Femme"}Chère{ }{contact.first_name}{elseif "{contact.gender}"=="Homme"}Cher{ }{contact.first_name}{else}Hi there{/if}  
  > **username_0**: thanks username_1, I'll try this way.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-06-10. Score: 0 | Accepted answer
  
  Gender wasn't properly define and @username_1 inspired me this little improvement:
  
  `{if "{contact.gender}"=="Femme"}Chère{ }{contact.first_name}{elseif "{contact.gender}"=="Homme"}Cher{ }{contact.first_name}{else}{contact.first_name}{/if}`
  
  
  ---
  
  