courtly
courtly
courtly
courtly

Upcoming Events

San Francisco CiviCRM Meetup - February 8th, 2012
February 8th, 2012
Come meet others from the Bay Area who are interested in, using or developing (more...)

UK usergroup - London meetup
February 8th, 2012
Come and meet others from the UK that are using CiviCRM or are interested in (more...)

London user and administrator training
February 23rd, 2012
A comprehensive two day hands on training course covering the configuration, (more...)

CiviCRM London sprint Feb 2012
February 27th, 2012
Following the CiviCRM training here in London, we will have a CiviCRM code (more...)

Philadelphia - CiviCRM Meetup for Q1 2012
March 13th, 2012

UK South West - CiviCRM Meetup
March 20th, 2012
Come meet others from the Area who are interested in, using or developing for (more...)

[Bristol, UK] user and administrator training
March 21st, 2012
A comprehensive hands on training course covering the configuration, (more...)

San Francisco user and administrator training
March 29th, 2012
A comprehensive two day hands on training course covering the configuration, (more...)

CiviCRM Usability, Test and Code Sprint - San Francisco (March 2012)
March 29th, 2012
This usability, code and test sprint is targeted at CiviCRM users and (more...)

CiviCon 2012 San Francisco Bay Area - April 2nd 2012
April 2nd, 2012
CiviCon is THE annual event bringing together the people who use, develop, (more...)

CiviCRM Documentation, Test and Code Sprint - after CiviCon San Francisco (April 2012)
April 4th, 2012
This sprint is targeted at CiviCRM users and developers who want to work on (more...)

CiviCRM Components

Tools for engaging your supporters...

CiviContribute


CiviEvent


CiviMail


CiviMember


CiviReport


Dealing with joint greetings (code provided)

Not Just a Contact Database

These optional components give you more power to connect and engage your supporters.

  • civiCASE

  • Case management for clients and constituents.

  • civiEVENT

  • Online event registration and participant tracking.

  • civiMEMBER

  • Online signup and membership management.

  • civiMAIL

  • Personalized email blasts and newsletters.

  • civiREPORT

  • Report generation and template management.

October 15, 2009 - 14:37 — SarahGladstone

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 in the blog ( 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 a new token called "contact.joint_greeting_casual". The code can be downloaded from jointgreetings.zip. After downloading and unzipping the file, follow the directions for using hooks with Joomla at the CiviCRM wiki.

I have tested my code in CiviCRM 2.2.8 and 3.0.1. I have tested it with both mailing labels and emails.

The logic is as follows:

If there is a spouse relationship defined and both people share a last name
= Jane and John Doe
= John and Jane Doe

If there is a spouse relationship defined and last names are different:
= Jane Smith-Doe and John Doe

If there is a spouse relationship defined and both people share a last name, and one or both have a title:
= Dr. Jane and John Doe
= Dr. John and Judge Jane Doe
= John and Dr. Jane Doe
( This is not 100% compliant with etiquette rules as the person with the title should be listed first and in the case of 2 people with the same title it should be Drs. Jane and John Doe)

If there is a spouse relationship defined and last names are different, and one or both have a title:
= Dr. Jane Smith-Doe and John Doe

If there is a household defined ( but no spouse relationships ) then the oldest 2 people in the household are treated as spouses.

If a women is widowed by a husband ( ie there is a spouse relationship between a woman and a deceased man with a shared last name)
= Mrs. John Doe

If a married person's title in their contact record is a "courtesy" title such as "Mr Ms Miss or Mrs" , then it is ignored.

If a single person ( not a widow) is encountered, then their "Display Name" is used as their greeting.

These formats are based on the rules at: Emily Post. For an interesting discussion for how to address a widow, check Business writing. In summary: how to address a widow: The proper etiquette is to use Mrs. John Smith, not Mrs. Jane Smith. This is because technically, Mrs. Jane Smith indicates a woman who has divorced but kept her husband's last name. Mrs. John Smith indicates a married woman or a widow.
Now, this is a distinction that is fast falling out of usage, so take it with a grain of salt. Sometimes rules change, but there are still older (and generally high-income) women who take this very seriously.

My own mother would have a heart-attack if she were a widow and received formal mail addressed as "Mrs. Sally Smith" as this implies she is divorced. ( The horror! what would the postal carrier think! ). Other women of her age often introduce themselves and sign their letters as Mrs. John Smith.

Also: Special thanks to Donald Lobo for helping me figure out the hooks for tokens.

-Sarah

( categories: )

Comments

Did anyone ever create a

Did anyone ever create a Drupal version of this.
... thanks.

drupal?

Is anyone working on a drupal module wrapper for Sarah's code?

Relationship and Mail Logic

Nice job Sarah!

Do you use Households at all in your setup? We've really appreciated being able to update the household address and have that change propagate to the individuals in that household. Your code seems like it would be a real advantage in conjuction with the Head of Household relationship. If there was one such relationship per household, selecting all records where that relationship exists when combined with your code would be very powerful!

Code has been updated

I updated the code to check for "head of household" relationships as well as "household member of". Download the code from the same link ( http://www.poger.net/utils/jointgreetings.zip). The code will treat the first 2 heads of households as spouses. If there is just 1 head of household or none, then the oldest 2 people will be treated as spouses.

Thanks,
Sarah

head of households

I am using households, but I am currently just checking for the oldest 2 people. I'll update my code to check for the head of household too. I am assuming you only have 1 or 2 people marked as head of household. How do deal with widows? Do you leave the deceased husband marked as "head of houshold"

Deceased Members

Well it's all hypothetical at this point because without your code, we've been mailing to households! For individual contacts I've relied on the fact at members with a recorded date of death are also marked as deceased and excluded from any mailing labels or email blasts.

I'm postulating using head of household as a way of selecting on recipient per household. If you have records for John Johnson, Jane Johnson and their household, without your code, we've named the household record using the joint greeting as a name, "Mr. & Mrs. John Johnson" and used household when we wanted to send to both persons.

Using your code, one could use the individual contacts, but could use a relationship, group or tag to limit the selected contacts and avoid generating two mailing labels to "Mr. & Mrs. John Johnson", one from John's record and one from Jane's.

avoiding duplicate mailing labels

What I have been doing is selecting everyone ( John Doe, Jane Doe, and their kids) then I check the box "Merge labels for contacts with the same address" to avoid duplicate mailing labels. So even thought my search criteria includes John Doe AND Jane Doe and their kids, there is only 1 mailing label generated.

Great post

Hi. Great post and very timely code! Have been thinking about that issue today as we migratedour contacts from our old database to civiCRM.
We don't neccesarily want to put do not email on some of our contacts but still want to be able to send out updates to them collectively at times.
Excellent work Mr. Gladstone and also thanks to Lobo too :-)