Answers.Body: <p>Greeting tokens can use smarty. You can set your default email greeting token at <code>civicrm/admin/options/email_greeting?reset=1</code>, and then in your mail use the greeting token <code>{contact.email_greeting_display}</code>.</p>
  <p>So then you can make the greeting token something like <code>Dear {if &quot;{contact.first_name}&quot; != &quot;&quot;}{contact.first_name}{else}Supporter{/if}</code></p>
  <p>To update existing contacts you'd need to first change their pref to the new one you've created, using something like <code>UPDATE civicrm_contact SET email_greeting_id=5 where contact_type='Individual'</code>, where 5 is the id of the new greeting, then run the scheduled job &quot;Update Greetings&quot; to update the greeting.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-17T19:52:16.460Z
Answers.Text: thought i saw a post recently about a new extension to help with this
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-18T08:26:54.330Z
Answers.Text: This works but only for new contacts.  If I update existing contacts with no first name it doesn't work - I checked the database table & these do appear to be blank.  Also this won't work with Mosaico?  The extension Pete mention is this https://github.com/systopia/de.systopia.moregreetings
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-18T12:17:17.757Z
Answers.Text: It should work with mosaico but yes you're right for existing contacts you'd also have to run a little script since their pref format would already be set to the previous pref. Will update answer.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-18T17:01:39.343Z
Answers.Text: Excellent, thanks.  The greeting works in Mosaico too.
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-17T14:20:00.420Z
Answers.LastActivityDate: 2022-08-19T11:37:13.887Z
Answers.LastEditDate: 2022-08-19T11:37:13.887Z
Answers.UserDisplayName: Demerit
Body: <p>When supporters are emailed it would be more personal to start 'Dear Joanna Smith' rather than 'Dear Supporter'.  Of course, sometimes we don't have a first name, and sometimes only an initial so using the tokens is tricky.  How do people handle this in a) traditional bulk emails and b) Mosaico?  Some examples would be useful</p>
  
Tags: <email><tokens><mosaico>
Title: Best way to fix the 'Dear [display_name} problem
ThreadText: # Best way to fix the 'Dear [display_name} problem
  
  (Asked by: username_0 on 2022-08-17)
  
  When supporters are emailed it would be more personal to start 'Dear Joanna Smith' rather than 'Dear Supporter'. Of course, sometimes we don't have a first name, and sometimes only an initial so using the tokens is tricky. How do people handle this in a) traditional bulk emails and b) Mosaico? Some examples would be useful
  
  **Tags:** email, tokens, mosaico
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-08-17. Score: 4 | Accepted answer
  
  Greeting tokens can use smarty. You can set your default email greeting token at `civicrm/admin/options/email_greeting?reset=1`, and then in your mail use the greeting token `{contact.email_greeting_display}`.
  
  So then you can make the greeting token something like `Dear {if "{contact.first_name}" != ""}{contact.first_name}{else}Supporter{/if}`
  
  To update existing contacts you'd need to first change their pref to the new one you've created, using something like `UPDATE civicrm_contact SET email_greeting_id=5 where contact_type='Individual'`, where 5 is the id of the new greeting, then run the scheduled job "Update Greetings" to update the greeting.
  
  > **Comments:**
  > **username_2**: thought i saw a post recently about a new extension to help with this  
  > **username_0**: This works but only for new contacts.  If I update existing contacts with no first name it doesn't work - I checked the database table & these do appear to be blank.  Also this won't work with Mosaico?  The extension Pete mention is this https://github.com/systopia/de.systopia.moregreetings  
  > **username_1**: It should work with mosaico but yes you're right for existing contacts you'd also have to run a little script since their pref format would already be set to the previous pref. Will update answer.  
  > **username_0**: Excellent, thanks.  The greeting works in Mosaico too.  
  
  ---
  
  