1

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?

1 Answer 1

3

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}
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.