Answers.Body: <p>I don't think you can do just by configuring that pattern, but you could <a href="https://docs.civicrm.org/dev/en/latest/hooks/#custom-mail-merge-token" rel="nofollow noreferrer">write your own token</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-28T17:51:07.033Z
Answers.Text: Thanks @Aidan I made [this](https://github.com/artfulrobot/dearyou) (which one day would be good to merge with the Fancy Tokens extension)
Answers.UserDisplayName: artfulrobot
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-28T20:41:25.287Z
Answers.Text: That's a nice bit of work! @artfulrobot
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-28T14:06:55.347Z
Answers.LastActivityDate: 2019-02-28T14:06:55.347Z
Answers.UserDisplayName: Aidan
Answers.Body: <p>You can use <a href="https://civicrm.org/blog/antrik/enhancing-greetings-handling" rel="nofollow noreferrer">Smarty conditionals in greetings</a> in CiviCRM 4.5+.</p>
  
  <p>So the correct pattern would be:</p>
  
  <pre><code>{capture assign=first_name}{contact.first_name}{/capture}Dear {$first_name|default:Supporter},
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-28T17:51:50.713Z
Answers.Text: This is a good answer as it does not require any PHP coding or installing extensions.
Answers.UserDisplayName: artfulrobot
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-28T14:24:29.140Z
Answers.LastActivityDate: 2019-02-28T14:24:29.140Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>Contacts have an 'email greeting' field which can be customised on a per-contact basis, and takes its default from a pattern like <code>Dear {contact.first_name}</code>  <a href="https://docs.civicrm.org/user/en/latest/organising-your-data/contacts/#greetings-and-addressee-fields" rel="nofollow noreferrer">docs link</a></p>
  
  <p>Is it possible to enter a pattern that will show "Supporter" if there is no first name?</p>
  
Tags: <contacts>
Title: Email greeting settings for contacts without names
ThreadText: # Email greeting settings for contacts without names
  
  (Asked by: username_0 on 2019-02-28)
  
  Contacts have an 'email greeting' field which can be customised on a per-contact basis, and takes its default from a pattern like `Dear {contact.first_name}` [docs link](https://docs.civicrm.org/user/en/latest/organising-your-data/contacts/#greetings-and-addressee-fields)
  
  Is it possible to enter a pattern that will show "Supporter" if there is no first name?
  
  **Tags:** contacts
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-02-28. Score: 3 | Accepted answer
  
  You can use Smarty conditionals in greetings in CiviCRM 4.5+.
  So the correct pattern would be:
  {capture assign=first_name}{contact.first_name}{/capture}Dear {$first_name|default:Supporter},
  
  > **Comments:**
  > **username_0**: This is a good answer as it does not require any PHP coding or installing extensions.  
  
  ---
  
  ### Answer by username_1 on 2019-02-28. Score: 1
  
  I don't think you can do just by configuring that pattern, but you could [write your own token](https://docs.civicrm.org/dev/en/latest/hooks/#custom-mail-merge-token).
  
  > **Comments:**
  > **username_0**: Thanks @username_1 I made [this](https://github.com/username_0/dearyou) (which one day would be good to merge with the Fancy Tokens extension)  
  > **username_1**: That's a nice bit of work! @username_0  
  
  ---
  
  