Answers.Body: <p>Use Thank You Letters.
  This requires you to pull a contribution report of the donors you want to receive the email then create the letter to email them.</p>
  <ol>
  <li>Go to Find Contribution, set the date for last year, select the financial type(s), and Refresh Results. Check if you need to do any other filtering to get the people you need.</li>
  <li>Check &quot;All Records&quot;</li>
  <li>Under actions select &quot;Thank You Letters-Print or Email.&quot;</li>
  <li>On the Thank You screen Group by &quot;Whatever works for your grouping needs&quot; Separator set to &quot;Horizontal Cell&quot; and select print or email</li>
  <li>Create your letter adding token(s) to pull their donations or their {$contribution_aggregate} Whatever detail you want.</li>
  <li>Save &amp; Name the template for next time</li>
  </ol>
  <p>You will have to create the receipt so it pulls in the information you need. Below is our code. We use line items so you will have to edit this code to your needs.</p>
  <pre><code>    &lt;table border=&quot;0&quot; style=&quot;width: 900px;&quot;&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td width=&quot;30%&quot;&gt;&lt;img height=&quot;auto&quot; src=&quot;logo url here&quot; width=&quot;275&quot; /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&quot;text-align:left; font-weight: bold; padding-top:60px;&quot; width=&quot;50%&quot;&gt;{contact.addressee}&lt;/td&gt;
              &lt;th style=&quot;padding-top:60px; text-align:center; color:#70551F;padding-left:100px; &quot;&gt;2021 Contribution Statement&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&quot;text-align:left; &quot; width=&quot;40%&quot;&gt;{contact.street_address}&lt;/td&gt;
              &lt;td style=&quot;text-align:center; font-style: italic; color:#281c1d;padding-left:100px;  &quot;&gt;January 1, 2021 - December 31, 2021&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width=&quot;40%&quot;&gt;{contact.city}, {contact.state_province} {contact.postal_code}&lt;/td&gt;
              &lt;td style=&quot;text-align:center; font-style: italic; color:#281c1d; padding-left:100px; &quot;&gt;Federal Id # 27-4638772&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  
  &lt;p style=&quot;font-size:18px; font-weight: bold;font-style: italic; color:#70551F;&quot;&gt;Thank you for your support of XYZ Foundation in 2021&lt;/p&gt;
  
  &lt;p&gt;No goods or services were received for these Tax Deductible contributions&lt;/p&gt;
  
  &lt;table align=&quot;left&quot; cellpadding=&quot;4&quot; cellspacing=&quot;0&quot; class=&quot;table&quot; style=&quot;width: 875px;border: 1px solid #fff;&quot;&gt;
      &lt;tbody&gt;
          &lt;tr style=&quot;padding: 8px; border: 1px solid #fff;color:white; background-color: #70551F;&quot;&gt;
              &lt;th style=&quot;padding: 8px;&quot;&gt;Date&lt;/th&gt;
              &lt;th style=&quot;padding: 8px;&quot;&gt;Cont ID&lt;/th&gt;
              &lt;th style=&quot;padding: 8px;&quot;&gt;Contribution Designation&lt;/th&gt;
              &lt;th style=&quot;padding: 8px;&quot;&gt;Amount&lt;/th&gt;
          &lt;/tr&gt;
          &lt;!--
  
      {foreach from=$contributions item=contribution} {assign
      var=&quot;date&quot; value=$contribution.receive_date|date_format:&quot;%B %d %Y&quot;}
  {crmAPI var='result' entity='LineItem' action='get' contribution_id=$contribution.id} 
    {foreach from=$result.values item=lineitem} 
      
    --&gt;
          &lt;tr style=&quot;padding: 4px; border: 1px solid #281c1d;&quot;&gt;
              &lt;td style=&quot;font-size:.8em; padding: 1px; border: 1px solid #fff;&quot;&gt;{$date}&lt;/td&gt;
              &lt;td style=&quot;font-size:.8em; padding: 1px; border: 1px solid #fff;&quot;&gt;{$contribution.id}&lt;/td&gt;
              &lt;td style=&quot;font-size:.8em; padding: 1px; border: 1px solid #fff;&quot;&gt;{$lineitem.label}&lt;/td&gt;
              &lt;td style=&quot;font-size:.8em; text-align:right;padding: 1px; border: 1px solid #fff;&quot;&gt;$ {$lineitem.line_total}&lt;/td&gt;
          &lt;/tr&gt;
          &lt;!--
      {/foreach}{/foreach}
  
   --&gt;
          &lt;tr style=&quot;padding: 3px; border: 1px solid #281c1d;text-align:right;padding-top:10px;&quot;&gt;
              &lt;th colspan=&quot;3&quot; style=&quot;padding: 3px; border: 1px solid #fff;text-align:right;padding-top:10px;padding-right:20px;&quot;&gt;2021 Total Contributions&lt;/th&gt;
              &lt;td style=&quot;padding-right: 4px; border: 1px solid #fff;padding-top:10px;text-align:right;&quot;&gt;$ {$contribution_aggregate}&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-05T05:43:01.483Z
Answers.LastActivityDate: 2022-02-05T05:43:01.483Z
Answers.UserDisplayName: Iowa Boy
Answers.Body: <p>Alternate approach, since I was just wrestling with this: install the Fuzion Tokens extension. It gives you all kinds of useful tokens in various contexts, including things like total amount given this year/last year/all time, total deductible amount ditto.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-07T21:34:40.307Z
Answers.Text: good idea. another option is eg Summary Fields, which then means you can add a token for the 'custom field' which Summary Fields generates when it calculates eg 'last years contributions' (and if you set it to only add up Donations then you should get what you need)
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-08T00:00:22.757Z
Answers.Text: If your contributions only have one line item yes that seems a good approach. But assuming I'm looking at the right line (https://github.com/eileenmcnaughton/nz.co.fuzion.civitoken/blob/0f92dac82998a4d069f861528e858b84f374196b/tokens/contribution.inc#L131) the "non-deductible" field in civi may or may not be what you want when there's multiple line items - specifically it gets set to either the whole contribution amount or 0. An example is event + optional donation. Overall this is a suprisingly tricky subject to handle all the use-cases.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-07T20:07:37.543Z
Answers.LastActivityDate: 2022-02-07T20:07:37.543Z
Answers.UserDisplayName: Hilary Caws-Elwitt
Body: <p>I am working to create an email that contains required details for donations to US-based non-profits.  In this email, I need to include the donation amount that is collected from a contribution for patrons to file on their taxes with the IRS.  I'm not seeing a donation field that I can use, but I have read some posts on custom tokens and needing to add it to Home » CiviCRM » Administer CiviCRM » Custom Data</p>
  <p>Is that the process or should I do something else?</p>
  <p>Thanks,</p>
  <p>E</p>
  
Tags: <donations>
Title: How to add a donation amount to an email that is sent from Civi
ThreadText: # How to add a donation amount to an email that is sent from Civi
  
  (Asked by: username_0 on 2022-02-05)
  
  I am working to create an email that contains required details for donations to US-based non-profits. In this email, I need to include the donation amount that is collected from a contribution for patrons to file on their taxes with the IRS. I'm not seeing a donation field that I can use, but I have read some posts on custom tokens and needing to add it to Home » CiviCRM » Administer CiviCRM » Custom Data
  
  Is that the process or should I do something else?
  
  Thanks,
  
  E
  
  **Tags:** donations
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-02-05. Score: 3
  
  Use Thank You Letters.
  This requires you to pull a contribution report of the donors you want to receive the email then create the letter to email them.
  
  Go to Find Contribution, set the date for last year, select the financial type(s), and Refresh Results. Check if you need to do any other filtering to get the people you need.
  Check "All Records"
  Under actions select "Thank You Letters-Print or Email."
  On the Thank You screen Group by "Whatever works for your grouping needs" Separator set to "Horizontal Cell" and select print or email
  Create your letter adding token(s) to pull their donations or their {$contribution_aggregate} Whatever detail you want.
  Save & Name the template for next time
  
  You will have to create the receipt so it pulls in the information you need. Below is our code. We use line items so you will have to edit this code to your needs.
      
      
          
              
          
          
              {contact.addressee}
              2021 Contribution Statement
          
          
              {contact.street_address}
              January 1, 2021 - December 31, 2021
          
          
              {contact.city}, {contact.state_province} {contact.postal_code}
              Federal Id # 27-4638772
          
      
  
  
  Thank you for your support of XYZ Foundation in 2021
  
  No goods or services were received for these Tax Deductible contributions
  
  
      
          
              Date
              Cont ID
              Contribution Designation
              Amount
          
          
          
              {$date}
              {$contribution.id}
              {$lineitem.label}
              $ {$lineitem.line_total}
          
          
          
              2021 Total Contributions
              $ {$contribution_aggregate}
  
  
  ---
  
  ### Answer by username_2 on 2022-02-07. Score: 1
  
  Alternate approach, since I was just wrestling with this: install the Fuzion Tokens extension. It gives you all kinds of useful tokens in various contexts, including things like total amount given this year/last year/all time, total deductible amount ditto.
  
  > **Comments:**
  > **username_3**: good idea. another option is eg Summary Fields, which then means you can add a token for the 'custom field' which Summary Fields generates when it calculates eg 'last years contributions' (and if you set it to only add up Donations then you should get what you need)  
  > **username_4**: If your contributions only have one line item yes that seems a good approach. But assuming I'm looking at the right line (https://github.com/eileenmcnaughton/nz.co.fuzion.civitoken/blob/0f92dac82998a4d069f861528e858b84f374196b/tokens/contribution.inc#L131) the "non-deductible" field in civi may or may not be what you want when there's multiple line items - specifically it gets set to either the whole contribution amount or 0. An example is event + optional donation. Overall this is a suprisingly tricky subject to handle all the use-cases.  
  
  ---
  
  