Improve default email greeting template
The default greeting template that ships with Core is Dear {contact.first_name}
For contacts with no first name it looks like this
I propose changing it to Dear {if '{contact.first_name}'}{contact.first_name}{else}Supporter{/if}
Which winds up like
Notes
- this is an English only change - but presumably non-English sites will see no change since there is either a customised version they are getting already or they are already getting the inappropriate 'Dear' & hence not using it
- the choice of word 'Supporter' - could be argued (Donor, Friend etc) - but I think if there is 'something' there then it will allow people to pick their own
- in workflow messages we currently use the field in this way
{assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}<p>{$greeting},</p>{/if}
- would would result in the offensive 'Dear,' - We already parse the greetings through Smarty so no change required there & because we use the
parseOneOffStringThroughSmarty
function smarty runs with higher security https://github.com/civicrm/civicrm-core/blob/95649f7c98ae3c384553f9958ebaf9caa03eb4a6/CRM/Core/Smarty.php#L183-L187 - The outstanding question is the impact on performance - which is what I will be testing next...