2

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

Is it possible to enter a pattern that will show "Supporter" if there is no first name?

2 Answers 2

3

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},
1
  • This is a good answer as it does not require any PHP coding or installing extensions. Feb 28, 2019 at 17:51
1

I don't think you can do just by configuring that pattern, but you could write your own token.

2
  • Thanks @Aidan I made this (which one day would be good to merge with the Fancy Tokens extension) Feb 28, 2019 at 17:51
  • 1
    That's a nice bit of work! @artfulrobot
    – Aidan
    Feb 28, 2019 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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