Dealing with joint greetings ( part 2 ) code provided.

Published
2010-02-16 21:18
Written by
SarahGladstone - member of the CiviCRM community - view blog guidelines

This is a follow up to my earlier blog entry at http://civicrm.org/node/651 The topic of how to properly greet and send mail to couples, such as "Jane and John Doe" has been discussed many times, such as at the blog post: http://civicrm.org/node/558. But the problem with the approach described there ( and included in CiviCRM 3.0 ) Is it requires information about someone's spouse in their contact record and marking half on the contacts "Do not mail" even though there are times when I DO want to communicate with just one spouse or the other for different events. So I wrote some code that implements some new tokens called "joint_greeting_casual", "joint_greeting_formal", "joint_greeting_formal_firstname". The code can be downloaded from civicrm_extras.zip. After downloading and unzipping the file, follow the directions for using hooks with Joomla or Drupal at the CiviCRM wiki.Some examples of the token output for couples and single contacts: joint_greeting_casual = John and Jane Doe Daniel Jones joint_greeting_formal = Mr. and Mrs. Doe Mr. Jones joint_greeting_formal_firstname = Mr. and Mrs. John Doe Mr. Daniel Doe These hooks have been tested with CiviCRM versions 2.2.8 and better, under both Drupal and Joomla. -Sarah

Filed under