This documentation refers to an older version of CiviCRM (3.4 / 4.0). View latest version.

Skip to end of metadata
Go to start of metadata
This page refers to CiviCRM 3.4 and 4.0, current STABLE version.

Documentation Search


CiviCRM 3.4 and 4.0 Documentation

Support and Participation

Developer Resources


CiviCRM books!

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

Or support us by buying an eBook or hard copy of Using CiviCRM from Packt Publishing.

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
{contact.city} - 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
{contact.country} - Country
{contact.phone} - Phone
{contact.email} - Email
{contact.im} - 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:

http://drupal.demo.civicrm.org/civicrm/admin/custom/group/field?action=update&reset=1&gid=1&id=1

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, profile, petition, or event registration form 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 sign up.  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.

Checksum for Contribution Pages: To send people to a contribution page, use this path where N is the ID of your contribution page:

  • Drupal: http://www.myorganization.org/civicrm/contribute/transact?reset=1&id=*N*&\{contact.checksum\}&cid=\{contact.contact_id\} (http://www.myorganization.org/civicrm/contribute/transact?reset=1&id=N&\{contact.checksum\}&cid=\{contact.contact_id\})
  • Joomla!: http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/contribute/transact&reset=1&id=*N*&\{contact.checksum\}&cid=\{contact.contact_id\} (http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/contribute/transact&reset=1&id=N&\{contact.checksum\}&cid=\{contact.contact_id\})

Checksum for standard Profiles: To send people to a profile, use this path where N is the ID of the Profile you want to send them to:

  • Drupal: http://www.myorganization.org/civicrm/profile/edit?reset=1&gid=*N*&id=\{contact.contact_id\}&\{contact.checksum\} (http://www.myorganization.org/civicrm/profile/edit?reset=1&gid=N&id=\{contact.contact_id\}&\{contact.checksum\})
  • Joomla!: http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/profile/edit&reset=1&gid=*N*&id=\{contact.contact_id\}&\{contact.checksum\} (http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/profile/edit&reset=1&gid=N&id=\{contact.contact_id\}&\{contact.checksum\})

Checksum for Event Registration Pages: To send people to an event registration page, use this path where N is the ID of your event:

  • Drupal: http://www.myorganization.org/civicrm/event/register?reset=1&id=*N*&\{contact.checksum\}&cid=\{contact.contact_id\} (http://www.myorganization.org/civicrm/event/register?reset=1&id=N&\{contact.checksum\}&cid=\{contact.contact_id\})
  • Joomla!: http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/event/register&reset=1&id=*N*&\{contact.checksum\}&cid=\{contact.contact_id\} (http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/event/register&reset=1&id=N&\{contact.checksum\}&cid=\{contact.contact_id\})

Checksum for Petition Signature Pages: To send people to sign a petition, use this path where N is the ID of your petition:

  • Drupal: http://www.myorganization.org/civicrm/petition/sign?sid=*N*&reset=1&cid=\{contact.contact_id\}&\{contact.checksum\} (http://www.myorganization.org/civicrm/petition/sign?sid=N&reset=1&cid=\{contact.contact_id\}&\{contact.checksum\})
  • Joomla!: http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/petition/sign&sid=*N*&reset=1&cid=\{contact.contact_id\}&\{contact.checksum\} (http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/petition/sign&sid=N&reset=1&cid=\{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: http://issues.civicrm.org/jira/browse/CRM-3853. Checksum for petitions is available in 4.1, and a patch for earlier versions is available here: http://issues.civicrm.org/jira/browse/CRM-9179.

Labels
  • None