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 CiviMail (Moderator: Piotr Szotkowski) »
  • Accessing billing location info in a Token instead of Primary
Pages: [1]

Author Topic: Accessing billing location info in a Token instead of Primary  (Read 1682 times)

MacRonin

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 14
Accessing billing location info in a Token instead of Primary
October 04, 2008, 12:32:03 pm
Most of the location information we have collected in our DB has come from processing credit-card charges, so it is stored in the Billing location. In some cases I would like to be able to access this info as a Token during a CiviMail mailing. According to : http://wiki.civicrm.org/confluence/display/CRMDOC/Mail-merge+Tokens+for+Contact+Data "For location fields, the primary location value will be used (this includes address, phone and email fields)." The Tokens listed on http://wiki.civicrm.org/confluence/display/CRMDOC/Mail-merge+Tokens+for+Contact+Data are generically  named and don't specify which location (primary/billing/etc.) to use, but do actually display the Primary. While a cascade effect would be preferred for the generically named Tokens(use generic variable and have a cascading selection order till one level is filled in), explicit named variable access could be a stop-gap.

Generic(Current):
Quote
{contact.street_address} - Street Address
{contact.supplemental_address_1} - Supplemental Address 1
{contact.supplemental_address_2} - Supplemental Address 2
{contact.city} - City

Explicit(idea):
Quote
{contact.primary.street_address} - Primary Street Address
{contact.primary.supplemental_address_1} - Primary Supplemental Address 1
{contact.primary.supplemental_address_2} - Primary Supplemental Address 2
{contact.primary.city} - Primary City

{contact.billing.street_address} - Billing Street Address
{contact.billing.supplemental_address_1} - Billing Supplemental Address 1
{contact.billing.supplemental_address_2} - Billing Supplemental Address 2
{contact.billing.city} - Billing City
« Last Edit: October 04, 2008, 12:37:14 pm by MacRonin »

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: Accessing billing location info in a Token instead of Primary
October 04, 2008, 01:21:24 pm

A community contribution for this would be great. Ideally extending the token system to deal with more specific db fields and be able to retrieve things like contribution data / membership data etc would make a very good enhancement :). This currently is not in our short/medium term plans.

However we will be adding a 'hook' to the token system in 2.2 (as part of the U.S. PIRG work), so you can potentially do it that way

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

MacRonin

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 14
Re: Accessing billing location info in a Token instead of Primary
October 04, 2008, 01:46:17 pm
That's what I figured :-( but glad to hear that a hook in 2.2 may be coming that might help with implementing this. I'm currently a solo effort on implementing the tech here, but may have some help coming. If they come(or I get some of that magical stuff called "Free-Time"), I'll put this on my/our to-do list. Unfortunately at the moment I have more ideas than resources ::)

Well at least I have it documented so I won't forget.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Accessing billing location info in a Token instead of Primary

This forum was archived on 2017-11-26.