Answers.Body: <p>In the post you linked you said you would use a code like this:</p>
  <blockquote>
  <p>{capture assign=gender}{contact.gender}{/capture}
  {if $gender eq 'Homme'} Cher {contact.first_name},
  {elseif $gender eq 'Femme'} Chère {contact.first_name},
  {/if}</p>
  </blockquote>
  <p>Instead of putting it directly in the template you could also add this smarty logic to the email greeting (/civicrm/admin/options/email_greeting?reset=1). CiviCRM would then generate the correct greeting for each contact and it also works with Mosaico etc.. For many of our German customers we use this logic to cover some more exceptions:</p>
  <blockquote>
  <p>{if &quot;{contact.communication_style}&quot;==&quot;familiär&quot;}{if &quot;{contact.individual_prefix}&quot;==&quot;Frau&quot;}Liebe{ }{contact.first_name}{elseif &quot;{contact.individual_prefix}&quot;==&quot;Herr&quot;}Lieber{ }{contact.first_name}{else}Liebe(r) Unterstützer(in){/if}{else}{if &quot;{contact.individual_prefix}&quot;==&quot;Frau&quot;}Sehr geehrte Frau {contact.formal_title}{ }{contact.last_name}{elseif &quot;{contact.individual_prefix}&quot;==&quot;Herr&quot;}Sehr geehrter Herr{ }{contact.formal_title}{ }{contact.last_name}{else}Sehr geehrte Damen und Herren{/if}{/if}</p>
  </blockquote>
  <p>There are two issues with this approach:</p>
  <p>If you change the greeting logic it will not automatically update all contacts. You could use the scheduled job that does that: (/civicrm/admin/job?action=update&amp;id=7&amp;reset=1)</p>
  <p>Also the maximum length for the smarty logic is limited so can't go too crazy. If you need more complex logic and/or more different greetings, please have a look a the extension &quot;<a href="https://github.com/systopia/de.systopia.moregreetings" rel="nofollow noreferrer">More Greetings</a>&quot; which we developed a while ago.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T09:34:23.113Z
Answers.Text: this is definitely a great answer @Fabian! Vielen Dank. I tried yesterday to change the greeting but I wasn't using the right syntax. Using your logic, it worked perfectly. This is the equivalent for French: {if "{contact.gender}"=="Femme"}Chère{ }{contact.first_name}{elseif "{contact.gender}"=="Homme"}Cher{ }{contact.first_name}{/if}
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-09T08:52:22.877Z
Answers.Text: Does it still work?
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-09T12:55:13.923Z
Answers.Text: If you mean the extension "More Greetings" then yes, it should still work.
Answers.UserDisplayName: Fabian
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-10T13:10:45.970Z
Answers.Text: I dont' use the 'More greetings' extension, I mean just using this smarty logic for contact.email_greeting. It was working fine until recently :-/
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-28T09:20:42.783Z
Answers.Text: @GuillaumeSorel it's probably far too late for you now, but this process is now called `update_greeting` rather than `update`. You can run it from the Scheduled Jobs console, just make sure you set `force=1` otherwise nothing much will happen.
Answers.UserDisplayName: Hugh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-28T14:23:43.307Z
Answers.Text: @Hugh thanks for the information
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-10T12:00:10.037Z
Answers.Text: I would advise against using `update_greeting` with `force=1`: although it does update all contacts and their greeting display it also changes the email greeting to the default option.
Answers.UserDisplayName: Philipp Michael
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-17T12:47:55.000Z
Answers.LastActivityDate: 2020-08-17T12:54:23.177Z
Answers.LastEditDate: 2020-08-17T12:54:23.177Z
Answers.UserDisplayName: Fabian
Body: <p>This was already <a href="https://civicrm.stackexchange.com/questions/31689/how-to-use-smarty-for-change-greetings-for-french">a topic</a> and I was able to fix it using Smarty and the help of the community but Smarty doesn't work with Mosaico and Greetings are showing pretty poorly in CiviCRM (dear e.g cher doesn't fit the feminine).</p>
  <p>Is there a way to set the Greetings because it's not just a French situation as German also has grammatical gender. Is this a PR?</p>
  
Tags: <contacts>
Title: How to change Greetings in CiviCRM?
ThreadText: # How to change Greetings in CiviCRM?
  
  (Asked by: username_0 on 2020-08-17)
  
  This was already [a topic](https://civicrm.stackexchange.com/questions/31689/how-to-use-smarty-for-change-greetings-for-french) and I was able to fix it using Smarty and the help of the community but Smarty doesn't work with Mosaico and Greetings are showing pretty poorly in CiviCRM (dear e.g cher doesn't fit the feminine).
  
  Is there a way to set the Greetings because it's not just a French situation as German also has grammatical gender. Is this a PR?
  
  **Tags:** contacts
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-08-17. Score: 3 | Accepted answer
  
  In the post you linked you said you would use a code like this:
  
  > {capture assign=gender}{contact.gender}{/capture}
  > {if $gender eq 'Homme'} Cher {contact.first\_name},
  > {elseif $gender eq 'Femme'} Chère {contact.first\_name},
  > {/if}
  
  Instead of putting it directly in the template you could also add this smarty logic to the email greeting (/civicrm/admin/options/email\_greeting?reset=1). CiviCRM would then generate the correct greeting for each contact and it also works with Mosaico etc.. For many of our German customers we use this logic to cover some more exceptions:
  
  > {if "{contact.communication\_style}"=="familiär"}{if "{contact.individual\_prefix}"=="Frau"}Liebe{ }{contact.first\_name}{elseif "{contact.individual\_prefix}"=="Herr"}Lieber{ }{contact.first\_name}{else}Liebe(r) Unterstützer(in){/if}{else}{if "{contact.individual\_prefix}"=="Frau"}Sehr geehrte Frau {contact.formal\_title}{ }{contact.last\_name}{elseif "{contact.individual\_prefix}"=="Herr"}Sehr geehrter Herr{ }{contact.formal\_title}{ }{contact.last\_name}{else}Sehr geehrte Damen und Herren{/if}{/if}
  
  There are two issues with this approach:
  
  If you change the greeting logic it will not automatically update all contacts. You could use the scheduled job that does that: (/civicrm/admin/job?action=update&id=7&reset=1)
  
  Also the maximum length for the smarty logic is limited so can't go too crazy. If you need more complex logic and/or more different greetings, please have a look a the extension "[More Greetings](https://github.com/systopia/de.systopia.moregreetings)" which we developed a while ago.
  
  > **Comments:**
  > **username_0**: this is definitely a great answer @username_1! Vielen Dank. I tried yesterday to change the greeting but I wasn't using the right syntax. Using your logic, it worked perfectly. This is the equivalent for French: {if "{contact.gender}"=="Femme"}Chère{ }{contact.first_name}{elseif "{contact.gender}"=="Homme"}Cher{ }{contact.first_name}{/if}  
  > **username_0**: Does it still work?  
  > **username_1**: If you mean the extension "More Greetings" then yes, it should still work.  
  > **username_0**: I dont' use the 'More greetings' extension, I mean just using this smarty logic for contact.email_greeting. It was working fine until recently :-/  
  > **username_2**: @username_0 it's probably far too late for you now, but this process is now called `update_greeting` rather than `update`. You can run it from the Scheduled Jobs console, just make sure you set `force=1` otherwise nothing much will happen.  
  > **username_0**: @username_2 thanks for the information  
  > **username_3**: I would advise against using `update_greeting` with `force=1`: although it does update all contacts and their greeting display it also changes the email greeting to the default option.  
  
  ---
  
  