2

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

1 Answer 1

4

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.

4
  • thought i saw a post recently about a new extension to help with this
    – petednz - fuzion
    Aug 17, 2022 at 19:52
  • 1
    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 github.com/systopia/de.systopia.moregreetings
    – Andy Clark
    Aug 18, 2022 at 8:26
  • 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.
    – Demerit
    Aug 18, 2022 at 12:17
  • 1
    Excellent, thanks. The greeting works in Mosaico too.
    – Andy Clark
    Aug 18, 2022 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.