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) »
  • Tokens not working {domain.name} and {domain.address}
Pages: [1]

Author Topic: Tokens not working {domain.name} and {domain.address}  (Read 1287 times)

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Tokens not working {domain.name} and {domain.address}
April 28, 2012, 05:38:15 pm
i recently upgraded to 4.1.2 and started setting up some  message templates. I sent a few tests to make sure they were going to look right and I noticed that in my sent message Civi didn't convert the {action.optOutUrl}, {domain.name} and {domain.address} tokens to their values.

It did convert {domain.name} to  http://domain.name

Below is the code in the template. I also have a {contact.first_name} twice in the template and it gets converted to the correct value.

Any ideas?


Code: [Select]
<tr>
      <td colspan="2" style="color: #000; font-family: Arial, Verdana, sans-serif; font-size: 10px;">
<hr />
       <p>
<font face="Arial, Verdana, sans-serif" size="2">To opt-out of all future mailings from us, <a href="{action.optOutUrl}">click here</a>.</font></p>
<font face="Arial, Verdana, sans-serif" size="2">This email was sent to you from:</font>

<p>
<font face="Arial, Verdana, sans-serif" size="2">{domain.name}. </font><br />
<font face="Arial, Verdana, sans-serif" size="2"> {domain.address} </font></p>
      </td>
</tr>

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: Tokens not working {domain.name} and {domain.address}
April 29, 2012, 06:00:21 pm
Still not working. The domain.XXXX aren't even showing up in the token popup box (if I remember they used to).


CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Tokens not working {domain.name} and {domain.address}
May 02, 2012, 10:19:11 am
If you are really using 4.0.7 I would suggest an upgrade to 4.0.8.    4.0.8 is a generally stable release and does fix some known issues in 4.0.7.  Also it might be obvious but please double check make sure you have specified your domain values here: /civicrm/admin/domain?action=update&reset=1

I have tested this and it does appear to be working on the CiviCRM.org site which uses 4.1.1.  These are results of the tokens, you can see the values are not blank.
Quote

________________________________________
To opt-out of all future mailings from us, click here.
This email was sent to you from:
CiviCRM.
CiviCRM
330 Upper Terrace
San Francisco, CA 94117
United States
cs=d52a9d9aac9c5eab9b097989775dda75_1335978902_168
CiviCRM
330 Upper Terrace
San Francisco, CA 94117
United States
CiviCRM

Try CiviTeacher: the online video tutorial CiviCRM learning library.

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: Tokens not working {domain.name} and {domain.address}
May 02, 2012, 10:45:27 am

also note that domain tokens are replaced only when sending via civimail. If you are using the message template in a different context those tokens will not be replaced

I do think that domain tokens should be replaced everywhere. Would be good for the future to:

1. Centralize the token code evaluation

2. Implement better token strategies like the above for the next release

3. Pass as much context info as possible

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

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Tokens not working {domain.name} and {domain.address}
May 02, 2012, 11:52:20 am
Quote from: Donald Lobo on May 02, 2012, 10:45:27 am

also note that domain tokens are replaced only when sending via civimail.

Good point, Lobo.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Tokens not working {domain.name} and {domain.address}
July 09, 2012, 01:09:21 am
Note that I get {domain.name} etc in standard workflow templates. I'm using 4.1.3 so this has either been recently added, or there is some other reason @FrTommy is having problems.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Tokens not working {domain.name} and {domain.address}

This forum was archived on 2017-11-26.