Year End Tax Receipt for Donors

Easy peasy list of all last year’s donations

Send your donors (contact records only) a tax receipt at the beginning of the new year listing all of last year’s donations. For Salesforce Nonprofit Success Pack users, this unmanaged package will generate a table for each donor listing the gifts they made last year. Use your own email to send a tax receipt by email. The table lists the amount, date and, optionally, the campaign name of each donation.

Package includes this sample template.

UPDATE 1/12: Now available on AppExchange!

CORRECTION 1/10: It does NOT work with Microsoft Word/Excel Mail Merge! I have not figured out how to get it to work. So sorry!

Thanks for the great app, just in time…Simple, easy, elegant, and just what we needed.

David, Eaglesrest.org

Caveats

This tool doesn’t decided for you what gifts should be tax deductible. It doesn’t provide a fair market value. I’m not deciding that for you. I’m not giving you any tax advice. Salesforce is not giving you any tax advice. Please talk to your tax advisor to decide what gifts should be tax deductible.

You will have to open the developer console to run this. I didn’t get a button made. I’m sorry. But try it out. The dev console isn’t that scary!

It does not work for donations from accounts.

Install from AppExchange

Click here to go to AppExchange to install the app.

Requires Nonprofit Success Pack.

How It Works

This package will populate a custom field Gifts_Last_Year__c.

  • Contact Criteria: Total Gifts Last Year > 0
  • Opportunity Criteria:
    • Closed Date = Last Year (so that’d be 2021 – Happy New Year!)
    • IsWon = True (so that means any opportunities that were “Closed Won” or “Posted,” whatever you call the stage or status)
  • Customizable Rollups must be enabled in NPSP.

It works in batches so it should be able to handle many gifts at once!

Here’s a screen shot of my page layout with the custom field Gifts Last Year populated.

What It Doesn’t Do

This package will not send the email for you. You can modify the template that’s included with the package if you want to send the email out through Salesforce. You can use the custom field Gifts Last Year in your preferred email marketing tool.

This package does not have an admin friendly button to run it. You’re going to have to go into the dev console, paste in some code, and click a button. Sorry about that! It’s not hard, though, and I’ve provided detailed instructions.

Set Up Instructions

  1. Install in Sandbox org with NPSP.
    1. Install for Admins only is fine. There is a permission set included if you need to give others the ability to access the field or see the apex.
  2. Add Gifts Last Year custom field to your Contact page layout.
  3. Make sure Total Gifts Last Year (an NPSP rollup field) is up to date. If you just entered gifts from last year today, you’ll want to force that roll up now.
    1. Go to NPSP Settings from App Manager.
    2. Select Bulk Data Processes.
    3. Select Rollup Donation Batch.
    4. Click Run Batch.
  4. Click on the Setup Icon.
  5. Click on Developer Console from the drop down menu.
  6. Do you want your gift table to list just Gift Amount and Gift Date? Copy the code below. (If you’re watching the video, you’ll have slightly different instructions).
Id batchJobId = Database.executeBatch(new yearEndGiftBatch());

Do you want your gift table to also include the Campaign Name of the gift? If so, copy the code below instead.

Id batchJobId = Database.executeBatch(new yearEndCampaignTable());

Now you’re ready to run your code!

  1. Click on Debug in the menu at the top of the dev console.
  2. Select Open Execute Anonymous Window.
  3. Delete anything that’s there if necessary and paste in the code you copied.
  4. Click Execute. You’ll get a confirmation email when it’s done.

Now you’re ready to send your emails or merge your letters!

  • You decide who will get the email and how you send it. Remember, the field is only populated on contacts with Total Gifts Last Year > 0.
  • Include the merge fields Gifts Last Year and Total Gifts Last Year in your template or copy the email template included in the package.

How to Add Columns

Look at my code that’s here on GitHub. Give it a try even if you haven’t looked at Apex code before! Compare the yearEndGiftBatch class with yearEndGiftCampaignTable class, which also includes the name of the campaign in the gift table. I’ve added in additional instructions starting on Line 6 to yearEndGiftCampaignTable that aren’t in the package.

Another way to see the differences is to copy the code from Comparison V1 and Comparison V2 and paste them into this code comparison tool. I removed the comments from these files to make it easier to see what’s different. I hope this helps!

Modify for Fiscal Year

  • By default, the package works for gifts made last calendar year. Let’s modify it to be based on your fiscal year.
  • Go to NPSP Settings from App Launcher.
  • Under Donations on the left, select Customizable Rollups.
  • Click Configure Customizable Rollups.

Gratitude

  • Thanks to my colleagues David Fromstein and David Glick for their support on this project. David F. built a gorgeous admin-friendlier version of this that we hope to deliver to you at some point.
  • Thanks to my colleague Alison Zwecker who installed the package for the first organization, Girl Build!
  • Narender Singh who showed us how to make a data table with flow.

Feedback

Please let me know what you think! Are you using this for your letters? I’d love to list your organization here as a user.


    More About Emails with Tables

    • Year End Tax Receipt for Donors

      Send your donors a tax receipt at the beginning of the new year listing all of last year’s donations. For Salesforce Nonprofit Success Pack users, this tool will generate a table for each donor listing the gifts they made last year. Use your own email tool to send a tax receipt. The table lists the amount, date and, optionally, the campaign name of each donation.


    • Send Tables in Email in Flow – NPSP Example #2 Memorial Gifts

      Send an email with Salesforce NPSP listing all the donations/opportunities made in tribute, memory or honor of someone. With a few clicks, an email will be sent out with a table of all relevant donations.


    • Send Emails with Tables in Flow – NPSP Example with Payments

      This post is building on the work of the super-smarty Narender Singh aka ForcePanda aka @Nads_P07. With Spring ’21 rich text emails, you can now send tables with lists of child objects. I followed his tutorial and built two flows specifically using Nonprofit Success Pack (NPSP) objects. The first one is a list of payments … Continue reading Send Emails with Tables in Flow – NPSP Example with Payments


    Published by

    JessieRymph

    Jessie is Success Content Specialist at Salesforce.org. All opinions expressed on this blog are her own or those of the contributors. For fourteen, she has specialized in CRM, email marketing and fundraising platforms. Jessie co-led the Seattle Salesforce Non-Profit User Group in 2015-2016. She wrote a sh*tty first draft of a novel and hopes to do something with it some day.

    Leave a Reply