Answers.Body: <p>There are multiple "token" systems in CiviCRM depending on your context.</p>
  
  <p><code>{$totalAmount|crmMoney}</code> is a Smarty token, which only works in Smarty emails.  System Workflow messages are Smarty, traditional templates don't handle Smarty by default, but can; Mosaico templates don't support Smarty (by design).</p>
  
  <p>None of the approaches suggested above are without issues, but let's discuss them in turn.</p>
  
  <ul>
  <li><code>{latestcurrentmembership.allfee}</code> in Civitoken does NOT return the membership fee paid.  It returns the "minimum fee" for the membership type (see screenshot):
  <a href="https://i.sstatic.net/0qP7h.png" rel="noreferrer"><img src="https://i.sstatic.net/0qP7h.png" alt="enter image description here"></a></li>
  </ul>
  
  <p>If all of your memberships of a particular type are always the same cost, you can set the "minimum fee" and use this token to solve your problem.</p>
  
  <ul>
  <li><p>Even if you were using Smarty with your mailing, <code>{$totalAmount|crmMoney}</code> wouldn't be available as an option to you.  Mosaico mailings are sent to contacts, not to contributions; the "total amount" token wouldn't know which payment you were referring to.  Consider if instead you can use Thank-you emails or Scheduled Reminders or CiviRules instead of CiviMail.  There's the <a href="https://github.com/civicrm/org.civicrm.mosaicomsgtpl" rel="noreferrer">mosaicomsgtpl</a> extension that copies a Mosaico template to a traditional one for use with non-CiviMail mailings.</p></li>
  <li><p>When sending as a contact, you CAN use a token for "Total amount of latest completed contribution".  It's available in CiviToken, and depending on your situation, may solve your issue - but only considers completed contributions.  To change this, open the <code>civitoken</code> folder, go to <code>tokens/latestcontribs.inc</code>, and remove the line that reads <code>AND civicrm_contribution.contribution_status_id = 1</code> to consider all contributions, complete or not.</p></li>
  </ul>
  
  <p>Finally, some solutions that don't (yet) exist:</p>
  
  <ul>
  <li>The "Latest Membership Fee" token in CiviToken CAN return the actual amount - the author just didn't need to in her case, so she wrote a shortcut.  One could create such a token.</li>
  <li>I've got a task on my plate (probably for this month) to write tokens for contributions that can be filtered on financial type.  So instead of "Total amount of latest completed contribution" you can specify "Total amount of latest completed contribution with Financial Type of 'X'".  If this would solve your problem, let me know on <a href="https://chat.civicrm.org" rel="noreferrer">https://chat.civicrm.org</a> and I'll let you know when I get to it.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-10T11:12:52.053Z
Answers.Text: Hi Jon G. What an answer! Thank you so much to have taken the time to write it. I now much better understand the context and how to get my situation work. I'm also interested in your tokens.
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-09T19:51:31.777Z
Answers.LastActivityDate: 2020-01-09T19:51:31.777Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I want to use in a Mosaico template a token for the contribution and I found in a system template this string: <code>{$totalAmount|crmMoney}</code>.</p>
  
  <p>I tried to use it in my new template but it doesn't show in the email. I have the civitoken extension but <code>{latestcurrentmembership.allfee}</code> doesn't show because it's a "pay later" option and I guess this token works only when the membership is already paid.</p>
  
  <p>Any idea?</p>
  
Tags: <tokens><mosaico>
Title: Token for {$totalAmount|crmMoney}?
ThreadText: # Token for {$totalAmount|crmMoney}?
  
  (Asked by: username_0 on 2020-01-09)
  
  I want to use in a Mosaico template a token for the contribution and I found in a system template this string: `{$totalAmount|crmMoney}`.
  
  I tried to use it in my new template but it doesn't show in the email. I have the civitoken extension but `{latestcurrentmembership.allfee}` doesn't show because it's a "pay later" option and I guess this token works only when the membership is already paid.
  
  Any idea?
  
  **Tags:** tokens, mosaico
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-01-09. Score: 6 | Accepted answer
  
  There are multiple "token" systems in CiviCRM depending on your context.
  
  `{$totalAmount|crmMoney}` is a Smarty token, which only works in Smarty emails. System Workflow messages are Smarty, traditional templates don't handle Smarty by default, but can; Mosaico templates don't support Smarty (by design).
  
  None of the approaches suggested above are without issues, but let's discuss them in turn.
  
  * `{latestcurrentmembership.allfee}` in Civitoken does NOT return the membership fee paid. It returns the "minimum fee" for the membership type (see screenshot):
    [![enter image description here](https://i.sstatic.net/0qP7h.png)](https://i.sstatic.net/0qP7h.png)
  
  If all of your memberships of a particular type are always the same cost, you can set the "minimum fee" and use this token to solve your problem.
  
  * Even if you were using Smarty with your mailing, `{$totalAmount|crmMoney}` wouldn't be available as an option to you. Mosaico mailings are sent to contacts, not to contributions; the "total amount" token wouldn't know which payment you were referring to. Consider if instead you can use Thank-you emails or Scheduled Reminders or CiviRules instead of CiviMail. There's the [mosaicomsgtpl](https://github.com/civicrm/org.civicrm.mosaicomsgtpl) extension that copies a Mosaico template to a traditional one for use with non-CiviMail mailings.
  * When sending as a contact, you CAN use a token for "Total amount of latest completed contribution". It's available in CiviToken, and depending on your situation, may solve your issue - but only considers completed contributions. To change this, open the `civitoken` folder, go to `tokens/latestcontribs.inc`, and remove the line that reads `AND civicrm_contribution.contribution_status_id = 1` to consider all contributions, complete or not.
  
  Finally, some solutions that don't (yet) exist:
  
  * The "Latest Membership Fee" token in CiviToken CAN return the actual amount - the author just didn't need to in her case, so she wrote a shortcut. One could create such a token.
  * I've got a task on my plate (probably for this month) to write tokens for contributions that can be filtered on financial type. So instead of "Total amount of latest completed contribution" you can specify "Total amount of latest completed contribution with Financial Type of 'X'". If this would solve your problem, let me know on <https://chat.civicrm.org> and I'll let you know when I get to it.
  
  > **Comments:**
  > **username_0**: Hi Jon G. What an answer! Thank you so much to have taken the time to write it. I now much better understand the context and how to get my situation work. I'm also interested in your tokens.  
  
  ---
  
  