CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Intended use of Addressee
Pages: [1] 2

Author Topic: Intended use of Addressee  (Read 2143 times)

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Intended use of Addressee
December 19, 2012, 07:49:44 am
Can someone tell me what the "Addressee" field is intended to be used for please?  I am trying to see where this is used with any of the built-in templates.  I am considering using it for mailing labels where the organization designates a point of contact else I was considering creating a new field for organizations called Primary Contact or something like that which I could then include in mailing labels and profiles.  But I don't want to create a new field if this field is intended for what I am discussing.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Intended use of Addressee
January 09, 2013, 09:21:40 am
Just bumping this again in hopes that it might catch the eye of someone for an answer.  Thanks.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Intended use of Addressee
January 09, 2013, 11:40:06 am
The primary intended usage of Addressee is indeed for mailing labels. If you go Administer > Localizations > Address Settings you can see that the {contact.addressee} token is the first line in default Mailing Label format.

Addressee format defaults are set from Admin > Communications > Addressee Formats - out of the box this is {contact.organization_name} for organizations. You can use 'Customized' option when editing each organization and enter a person's name. However this approach is a bit brittle. Some folks use a relationship type to identify the 'Primary Contact' - but you'd need to set up a token hook I think to use that in mailing labels. There has been a fair amount of discussion about how best to support this 'Primary Contact' use case - but I don't think we have consensus on it since it means something different to different organizations. Relationship type seems the most flexible - but customizations (or some changes in core) are needed to expose it for profiles and make it more obvious in the staff UI.

Protect your investment in CiviCRM by  becoming a Member!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Intended use of Addressee
January 09, 2013, 01:58:42 pm
Okay, so what if I changed the Org one to a new field (key_contact) that I created just for organizations and that is a text field that can hold a name directly.  Would I be able to change the token to that field instead?  Would it be {contact.key_contact} or something else?

Thanks Dave.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Intended use of Addressee
January 09, 2013, 02:01:46 pm
Could I change it so it was several tokens?

Say

{contact.organization_name}
{organization.key_contact}
{organization.key_contact_title}

and then it would be in all mailings to Organizations

Is this possible?
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Intended use of Addressee
January 09, 2013, 03:24:50 pm
Hmm - given those req's, maybe the following (instead of using Addressee):
1. Create custom fields extending Organization contact type for Key Contact and Key Contact Title (Key Contact could be a 'Contact Reference' field if you want it to point to an existing individual contact record - but you'll need to play w/ use cases to see if there's gotchas for that).

2. I think you can then use the tokens for those custom fields in the Mailing Label format configuration (these would be {contact.custom_N) where N = id of each custom field). If you use mailing labels for Orgs AND Individuals you'll want to stick w/ {contact.addressee} to provide the Org or Individual name on the first line (since it covers both). I "THINK" that lines for the org-only custom fields will be suppressed if mailing label is addressed to an individual (i.e. the field would evaluate as empty) - however you'll need to test that.
Protect your investment in CiviCRM by  becoming a Member!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Intended use of Addressee
January 10, 2013, 07:25:54 am
Okay, thanks.  So what I did was basically create two custom fields for key contact and key contact title.  I then looked those up in my php admin tool and looked at that table to find the id #s (is there an easier way?) and then added them to the address settings and they were successful suppressed since the custom fields were of org type rather than contact type in general.  I then noticed that I would have to populate the addressee field for every contact since the default was not set in the records (unless I am mistaken, else there was not a name listed on the mailing labels), is there a way to set the addressee field to the respective defaults (individual, household, org)?  Seems like I would have thought this to be set from the beginning of record creation.  If not should I set this value by a SQL script?  For the time being I changed {contact.addressee} to {contact.display_name} to populate the names on the mailing labels.

Please let me know what I should do about the addressee field and thanks for the help/good advice.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Intended use of Addressee
January 10, 2013, 07:40:45 am
I may have discovered the issue.  It appears that those individuals that I imported did not get assigned their default addressee type.  Those records that are created using the CiviCRM interface autofill a default value for all of the Email Greeting, Postal Greeting and Addressee fields.  Hmm, any suggestions on how to go about fixing this easily or perhaps a routine that I could run to make all contacts update to the corresponding default values for these fields?
« Last Edit: January 10, 2013, 08:12:07 am by NASACT »
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Intended use of Addressee
January 10, 2013, 11:13:23 am
There's a scheduled job you can run which will populate empty Addressee values.
http://wiki.civicrm.org/confluence/display/CRMDOC42/Managing+Scheduled+Jobs
Protect your investment in CiviCRM by  becoming a Member!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Intended use of Addressee
January 11, 2013, 07:18:57 am
Hi Dave,

When I run that I get the following error recorded in the log.

2013-01-11 10:17:42   Greeting updater   
0
Summary
Finished execution of Greeting updater with result: Failure, Error message: Mandatory key(s) missing from params array: ct, gt
Details

Parameters parsed (and passed to API method):
a:1:{s:7:"version";i:3;}

Full message:
Finished execution of Greeting updater with result: Failure, Error message: Mandatory key(s) missing from params array: ct, gt
2013-01-11 10:17:41   Greeting updater   
0
Summary
Starting execution of Greeting updater
Details

Parameters parsed (and passed to API method):
a:1:{s:7:"version";i:3;}

Full message:
Starting execution of Greeting updater
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Intended use of Addressee
January 11, 2013, 07:27:33 am
Maybe I have to pass parameter to it by going to edit and adding in "command parameters" but not sure what I should be putting there besides ct= and gt= from the link you gave me where it says:

ct= (required: Individual, Organization, or Household)
gt= (required: email_greeting, postal_greeting, or addressee)
id= (optional: force script to set a greeting or addressee format other than default for a given contact type, use ID of format option value)
force=0 (1 to update all contacts, otherwise only contacts with null values are updated)

so would I put:

ct=Individual gt=email_greeting
ct=Individual gt=postal_greeting
ct=Individual gt=addressee
ct=Organization gt=email_greeting
ct=Organization gt=postal_greeting
ct=Organization gt=addressee

Or is there a specific way this needs to be typed in there? Commas, semicolons, etc.?
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Intended use of Addressee
January 11, 2013, 08:55:46 am
Okay, here is what I discovered to work for me.  Just an FYI, I could not find any way to format the parameters that it would take multiple entries of them so I had to do 6 runs to update three fields for both individuals and organizations.

So each time I replaced the parameters with the following entries INDIVIDUALLY since I couldn't do them together.  Just in case anyone else wants more clarity on how to use this Scheduled Job since the documentation is a bit unclear to proper syntax.

ct=Individual
gt=email_greeting
force=1

ct=Individual
gt=postal_greeting
force=1

ct=Individual
gt=addressee
force=1

ct=Organization
gt=email_greeting
force=1

ct=Organization
gt=postal_greeting
force=1

ct=Organization
gt=addressee
force=1
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Intended use of Addressee
January 11, 2013, 01:20:55 pm

adrian:

can you please update the wiki with your findings

Might be a good exercise to allow the script to send in multiple values of ct and gt and the script does the cross product

i.e. sending in

ct=Individual,Organization gt=email_greeting,postal_greeting,addressee

should handle the below. Would help if you can take a look and potentially contribute the required patch

lobo

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Intended use of Addressee
January 17, 2013, 01:15:56 pm
Sure can, not sure I know how to do that, any FAQ you can point me to for that process?
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Intended use of Addressee
January 22, 2013, 12:42:00 pm
Lobo - Did I do it right?

http://wiki.civicrm.org/confluence/display/CRMDOC42/Update+Greetings+and+Address+Data+for+Contacts

Thanks.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Intended use of Addressee

This forum was archived on 2017-11-26.