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) »
  • Changing System Workflow templates
Pages: [1]

Author Topic: Changing System Workflow templates  (Read 631 times)

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Changing System Workflow templates
January 17, 2011, 10:05:27 pm
I have made simple modifications (adding text, hyperlinks and customer info using tokens) to some System Workflow templates, but now I want to try adding an if/else statement so that the off-line contribution 'receipt' becomes a refund notification if the contribution amount is negative.
 
What "language" are these written in and where can I learn the syntax etc.  I thought it might be php, but it doesn't look like the php I find  at w3school. (no programming experience really - I can tinker successfully with mssql and a little bit of html and CSS when I have to, but that's all)

I think I might need to add something like the red lines to the existing blue lines of code but I'm not sure if I can nest if/else statements or not , and I not even sure if {if $formValues.total_amount neg} is correct way to identify negative contributions.

{if $formValues.total_amount neg}
<t> You refund has been processed as requested. </t>
else


 {if $formValues.receipt_text}
     <p>{$formValues.receipt_text|htmlize}</p>
    {else}
     <p>{ts}Thanks for your support.{/ts}</p>
    {/if}

     
    {/if}




xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Changing System Workflow templates
January 18, 2011, 12:56:05 am
That's smarty.

http://www.smarty.net/crash_course
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

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: Changing System Workflow templates
January 18, 2011, 01:27:43 am
It should be something like


Quote
{if $formValues.total_amount neg}
     <t> You refund has been processed as requested. </t>
{else}

 {if $formValues.receipt_text}
     <p>{$formValues.receipt_text|htmlize}</p>
    {else}
     <p>{ts}Thanks for your support.{/ts}</p>
 {/if}
     
{/if}

Hth

Kurund
Found this reply helpful? Support CiviCRM

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Changing System Workflow templates
January 18, 2011, 02:45:28 am
Thanks for the info.  I can see I'll have to concentrate on remembering the curly brackets.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Changing System Workflow templates

This forum was archived on 2017-11-26.