This documentation relates to CiviCRM version 3.3. It's not maintained anymore.
Current version of documentation.

Mail-merge Tokens for Contact Data

Aller directement à la fin des métadonnées
Aller au début des métadonnées

This page refers to outdated version of CiviCRM. Check current version of documentation.

Documentation Search

CiviCRM 3.3 Documentation

Support and Participation

Developer Resources

CiviCRM book!

Make sure to check out Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

Tokens allow you to include personalized text in email messages (similar to "mail-merge" functionality in a word processor). You can use the tokens listed below in your CiviMail Messages, as well as in the Send Email to Contact(s) feature (accessed from the contact summary screens and search results) AND Mailing Labels.

Refer to CiviMail Action Tokens to learn about tokens you can use to insert into CiviMail messages for actions like forwarding and unsubscribing.

You might start an email with a greeting like this:
Dear {contact.first_name},
Thanks for volunteering at....
Which will be sent to Ms. Dana Helpful as:
Dear Dana,
Thanks for volunteering at....

Tokens for Standard Contact Fields

The following standard contact field tokens are available. For location fields, the primary location value will be used (this includes address, phone and email fields).

{contact.first_name} - First Name
{contact.middle_name} - Middle Name
{contact.last_name} - Last Name
{contact.job_title} - Job Title
{contact.birth_date} - Birth Date
{contact.gender} - Gender
{contact.individual_prefix} - Individual Prefix
{contact.individual_suffix} - Individual Suffix
{contact.street_address} - Street Address
{contact.supplemental_address_1} - Supplemental Address 1
{contact.supplemental_address_2} - Supplemental Address 2
{} - City
{contact.postal_code_suffix} - Postal Code Suffix
{contact.postal_code} - Postal Code
{contact.geo_code_1} - Geo Code 1
{contact.geo_code_2} - Geo Code 2
{contact.county} - County
{contact.state_province} - State
{} - Country
{} - Phone
{} - Email
{} - IM Screen Name
{contact.nick_name} - Nick Name
{contact.email_greeting} - Email Greeting for this contact
{contact.postal_greeting} - Postal Greeting for this contact
{contact.do_not_email} - Do Not Email
{contact.do_not_phone} - Do Not Phone
{contact.do_not_mail} - Do Not Mail
{contact.external_identifier} - External Identifier
{contact.home_URL} - Home URL
{contact.preferred_communication_method} - Preferred Communication Method
{contact.preferred_mail_format} - Preferred Mail Format
{contact.do_not_trade} - Do Not Trade
{contact.is_opt_out} - No Bulk Mail (Opted-out)
{contact.contact_id} - Internal Contact ID
{contact.contact_source} - Source of Contact Data
{contact.checksum} - Use this in conjunction with {contact.contact_id} to create links to Profiles or Contribution Pages which allow anonymous users to edit their existing contact data (limited to the fields which you have configured / exposed in those forms)

Tokens for Custom Fields

To insert a token which references a custom field value, use custom_ plus the custom field ID. For example, to reference the custom field whose ID = 3 -> {contact.custom_3}

You can confirm a custom field ID by navigating to Administer CiviCRM » Custom Data » View and Edit Field. Then mouse over the Edit link for the field and check the id= value of the Edit URL. For example, for custom field 1 on the demo site the Edit link is:

Tokens for the custom fields included in CiviCRM sample data:
{contact.custom_1} - Most Important Issue
{contact.custom_2} - Marital Status

The data for Custom Fields does not get displayed in the Preview pane of civiMail, however it does get sent out in the Test email. Core contact data does get displayed in the Preview pane

More On Checksum Tokens

There is a very powerful feature to allow you to send an email with CiviMail to your constituents with a link to the contribution form or profile with all of their contact information already filled in! This saves them the hassle of filling it out and increasing the chances they would ultimately donate.  Or it can be a simple way to periodically allow people to review their contact info and update it if applicable.

The way it works is you create a "special" link in the CiviMail message that includes the checksum token {contact.checksum}. When people click on the special link, it looks them up in the database and prefills any information on the contribution form or profile with any data that exists in their record. The special link lasts for seven days from the time it was sent out.To send people to a contribution page use this path: [{contact.checksum}&cid={contact.contact_id}|{contact.checksum}&cid={contact.contact_id} where N is the ID of your contribution page.

To send people to a profile use this path: |{contact.contact_id}&{contact.checksum} where N is the ID of the Profile you want to send them to. For Joomla! users this would be |{contact.contact_id}&{contact.checksum}

Also note that the checksum token exists at least back to 2.0.7, but can only be used in profile editing (i.e. not for transactions) until version 2.2, but if you'd like it to work for earlier versions, see the patch here:

  • Aucun

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.