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) »
  • Revised Mail Template: Smarty Error/Parse Error
Pages: [1]

Author Topic: Revised Mail Template: Smarty Error/Parse Error  (Read 3408 times)

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Revised Mail Template: Smarty Error/Parse Error
January 27, 2010, 10:25:16 am
I am attempting to modify the default mail template.  I made one modification, using the "insert tokens" feature (very nice by the way).  I simply inserted {contact.first_name}.

When I process the registration, the user is given an error:
Code: [Select]
Parse error: syntax error, unexpected ':' in /home/.../public_html/sites/.../files/civicrm/templates_c/en_US/en_US/%%B5/B5B/B5B0F3E7%%if%7D.php on line 1618
When I check the logs, I get over 20 of the same Smarty error:
Code: [Select]
Smarty error: [in string:{if $event.confirm_email_text AND... (the whole template code)... {foreach from=$value item=v key=n} {$n}: {$v} {/foreach} {/foreach} {/if} line 110]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590) in /home/.../public_html/sites/..../modules/civicrm/packages/Smarty/Smarty.class.php on line 1093.
I have tried this with "{contact.first_name}" and "{$contact.first_name}".  Same errors generated.

When this happens, the user IS registered, but the email fails in a rather spectacular way.  I only want to add the registrants first and last name to all receipt emails.

P.s.  This is on civi 3.1.beta6
Thanks,
Maria

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: Revised Mail Template: Smarty Error/Parse Error
January 27, 2010, 11:13:18 am

if i had to guess we are not doing "civicrm token" substitution in the message templates (hence the error)

smarty is however doing the smarty token substition, so if you can find and use the smarty tokens that would be a workaround for now

i suspect we will not be introducing "civicrm tokens" to those templates in the 3.1 release. we'll probably work on suppressing the insert tokens if we display it in the editor for the message templates

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

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Revised Mail Template: Smarty Error/Parse Error
January 27, 2010, 11:14:51 am
no problem trying a workaround...can you direct me to a smarty tokens list?  Something I can muddle through?

thanks
m

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Revised Mail Template: Smarty Error/Parse Error
January 27, 2010, 11:20:42 am
Quote
no problem trying a workaround...can you direct me to a smarty tokens list?  Something I can muddle through?
Check http://wiki.civicrm.org/confluence/display/CRMDOC/Debugging

Kurund
Found this reply helpful? Support CiviCRM

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Revised Mail Template: Smarty Error/Parse Error
January 27, 2010, 01:13:42 pm
Hm.  I enabled the debug, but no clear variables for name, first name, display name are evident.  Or rather, i can see some of them, but if I put them in the template it pops out an error. 

Unless someone simply knows the variable for the contact's display name (which is not actually called in the form itself), I can put it in the form and then it will appear in the email.  Just hoping to have less fields on the form. Not a big deal. 

Though when this IS decided, I would like to utilize civicrm tokens in emails.  So +1 for the feature.

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Revised Mail Template: Smarty Error/Parse Error
February 03, 2010, 02:24:42 am
Quote from: mariagwyn on January 27, 2010, 10:25:16 am
I am attempting to modify the default mail template.  I made one modification, using the "insert tokens" feature (very nice by the way).  I simply inserted {contact.first_name}.

When I process the registration, the user is given an error:
Code: [Select]
Parse error: syntax error, unexpected ':' in /home/.../public_html/sites/.../files/civicrm/templates_c/en_US/en_US/%%B5/B5B/B5B0F3E7%%if%7D.php on line 1618

I believe we fixed this error in CiviCRM 3.1.1 (if you look into the page’s source, you’ll see that the error is really about " being escaped to " or & being escaped to &).
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Revised Mail Template: Smarty Error/Parse Error
February 03, 2010, 09:51:03 am
I am receiving the error in civicrm 3.1.1.  At first, I did assume it was because of a stray " but I could not get the syntax correct.  So, perhaps you can help.  If I want to add a row in the table that will include a first and last name, or a display name, I add WHAT exactly:

Code: [Select]
<tr><td>
???????
</td></tr>

thanks, m

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Revised Mail Template: Smarty Error/Parse Error
February 03, 2010, 10:41:33 pm
Quote from: mariagwyn on February 03, 2010, 09:51:03 am
If I want to add a row in the table that will include a first and last name, or a display name, I add WHAT exactly:

Code: [Select]
<tr><td>
???????
</td></tr>

The below should work:

Code: [Select]
<tr><td>
{contact.first_name} {contact.last_name}
</td></tr>

(But from your report above I assume it doesn’t – if I’m right, can you verify on our demo server?)
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Revised Mail Template: Smarty Error/Parse Error
February 04, 2010, 09:27:56 am
I can't test correctly on demo since it isn't sending out emails.  On my site, the contribution returns the error on the final contribution click when it tries to send out the email receipt.  Since this process isn't run on the demo site, I can't finish the test.

However, this is exactly the format I used on my site.

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: Revised Mail Template: Smarty Error/Parse Error
February 04, 2010, 11:13:29 am

demo does send out emails. it sends them to /dev/null. so if there is an error with the email sending, it will replicate on demo also

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

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Revised Mail Template: Smarty Error/Parse Error
February 04, 2010, 01:01:35 pm
When I post a contribution, I receive this error: : 10002:Security error Security header is not valid

I assumed this meant that emails were not sent.  I set my own email as a 'CC' on the form, but have not received the email.  The error on my site only occurs when the email is processed, at least I assume that is when.

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Revised Mail Template: Smarty Error/Parse Error
February 15, 2010, 04:35:17 am
Hm. I just checked and on a fresh CiviCRM 3.1 install changing the ‘Contributions - Receipt (off-line)’ message template does work. Can you try reverting it to default and changing?

(I added ‘{contact.first_name} {contact.last_name}’ after the ‘Thanks for your support’ text and it got populated with my contact’s first and last name in the email.)
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Revised Mail Template: Smarty Error/Parse Error

This forum was archived on 2017-11-26.