How to change Greetings in CiviCRM?
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 &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}

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&amp;id=7&amp;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 &quot;More Greetings&quot; which we developed a while ago.