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) »
  • Using mail merge tokens for other than primary addresses
Pages: [1]

Author Topic: Using mail merge tokens for other than primary addresses  (Read 810 times)

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Using mail merge tokens for other than primary addresses
November 14, 2011, 01:33:02 pm
We collect voting state and post code data for our contacts and wish to be able to refer to those values in CiviMail. If we use the mail merge tokens, we don't seem to be able to do that, for example {contact.postal_code} returns the postal code for the primary address.

Our address type is "voting" so we would like to be able to use {voting.postal_code} but that does not work, of course.

Any workarounds?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Using mail merge tokens for other than primary addresses
November 14, 2011, 08:55:13 pm
Hi,

Not sure you can do that out of the box. You could create custom token (using hooks).

At one point, we discussed being able to provide param to the token (eg. give the location type ''voting"). Not sure if it's been implemented at the end.

@lobo?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

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: Using mail merge tokens for other than primary addresses
November 15, 2011, 07:03:16 am

For now the easiest alternative is to implement the token hook

there has been discussions about adding "parameter" support to tokens, but so far no one has worked on it and/or funded it. I suspect it will be in discussion mode for some more time :(

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

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Using mail merge tokens for other than primary addresses
November 15, 2011, 12:48:28 pm
From what I have read, token hook wasn't added until 2.2, so may I assume this is not an option for 1.9?

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: Using mail merge tokens for other than primary addresses
November 15, 2011, 01:40:10 pm

yes. that is a logical assumption :)

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

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Using mail merge tokens for other than primary addresses
February 17, 2012, 11:32:51 am
Was any work done on this for 4.1? We are probably going to jump from 1.9 to 4.1 in the "near future".

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: Using mail merge tokens for other than primary addresses
February 17, 2012, 11:39:20 am

No. You'll need to use the token hook for this

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Using mail merge tokens for other than primary addresses

This forum was archived on 2017-11-26.