Answers.Body: <p>Well after MUCH testing and playing around, I figured out what I needed, and I post it here in hopes it will help other noobs...</p>
  <ul>
  <li><p>Financial Type Name was retreived using <code>$contribution.financial_type</code></p>
  </li>
  <li><p>Contribution Source was retrieved using <code>$contribution.contribution_source</code></p>
  </li>
  <li><p>Financial Type Is Deductible was not available in the data that was already retreived, so had to make another call to find that out. Using the Financial Type ID from <code>$contribution.financial_type_id</code>, I did the following:</p>
  <pre><code>{crmAPI var='resultFinancialType' entity='FinancialType' action='get' id=$financial_type_id}
  {assign var=&quot;financial_type_is_deductible&quot; value=$resultFinancialType.values[0].is_deductible}
  {if $financial_type_is_deductible eq '1'}
     {assign var=&quot;financial_type_is_deductible&quot; value=&quot;Tax-Deductible&quot;}
  {else}
     {assign var=&quot;financial_type_is_deductible&quot; value=&quot;Non tax deductible&quot;}
  {/if}
  </code></pre>
  </li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-14T03:20:58.720Z
Answers.LastActivityDate: 2022-05-14T03:20:58.720Z
Answers.UserDisplayName: jsherk
Body: <p>I am using Thank You letter template to generate donation receipt. After using Find Contributions, I then choose All Records and from Actions I choose Thank You Letters.</p>
  <p>I can then add smarty logic and am able to show the contacts name and address as well as some things like date of contribution ($contribution.receive_date) and the total amount of contribution ($contribution.total_amount) and also the ID of the Financial Type ($contribution.financial_type_id)</p>
  <p>But I am not able to figure out how to get the following:</p>
  <ul>
  <li>Financial Type Name ($contribution.financial_type_id.name does not work.. always returns 1)</li>
  <li>Contribution Source ($contribution.source does not work.. always returns blank)</li>
  <li>Financial Type Is Deductible ($contribution.financial_type_id.is_deductible does not work.. always returns 1)</li>
  </ul>
  <p>I am basing what I am doing from this answer by Iowa Boy
  <a href="https://civicrm.stackexchange.com/questions/41120/how-to-print-usa-tax-receipt-to-individuals#41136">How to print USA tax receipt to individuals?</a></p>
  
Tags: <wordpress><civicontribute><receipts><smarty>
Title: How to get the Financial Type name/label in Smarty template?
ThreadText: # How to get the Financial Type name/label in Smarty template?
  
  (Asked by: username_0 on 2022-05-14)
  
  I am using Thank You letter template to generate donation receipt. After using Find Contributions, I then choose All Records and from Actions I choose Thank You Letters.
  
  I can then add smarty logic and am able to show the contacts name and address as well as some things like date of contribution ($contribution.receive\_date) and the total amount of contribution ($contribution.total\_amount) and also the ID of the Financial Type ($contribution.financial\_type\_id)
  
  But I am not able to figure out how to get the following:
  
  * Financial Type Name ($contribution.financial\_type\_id.name does not work.. always returns 1)
  * Contribution Source ($contribution.source does not work.. always returns blank)
  * Financial Type Is Deductible ($contribution.financial\_type\_id.is\_deductible does not work.. always returns 1)
  
  I am basing what I am doing from this answer by Iowa Boy
  [How to print USA tax receipt to individuals?](https://civicrm.stackexchange.com/questions/41120/how-to-print-usa-tax-receipt-to-individuals#41136)
  
  **Tags:** wordpress, civicontribute, receipts, smarty
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-05-14. Score: 3 | Accepted answer
  
  Well after MUCH testing and playing around, I figured out what I needed, and I post it here in hopes it will help other noobs...
  
  * Financial Type Name was retreived using `$contribution.financial_type`
  * Contribution Source was retrieved using `$contribution.contribution_source`
  * Financial Type Is Deductible was not available in the data that was already retreived, so had to make another call to find that out. Using the Financial Type ID from `$contribution.financial_type_id`, I did the following:
  
    ```
    {crmAPI var='resultFinancialType' entity='FinancialType' action='get' id=$financial_type_id}
    {assign var="financial_type_is_deductible" value=$resultFinancialType.values[0].is_deductible}
    {if $financial_type_is_deductible eq '1'}
       {assign var="financial_type_is_deductible" value="Tax-Deductible"}
    {else}
       {assign var="financial_type_is_deductible" value="Non tax deductible"}
    {/if}
  
    ```
  
  
  ---
  
  