UPDATE 1/13/23: If you’re installing today from AppExchange, it’s a new version 1.4 that you can run by running a flow called Year End Tax Flow. New detailed instructions below. To install the new version, please uninstall the old version first! Go to Setup, search for “Installed Packages,” find “Year End Tax” and uninstall that.
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.
- You must re-run the app every year! It does not update on its own!
- 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.
- It does not work for donations from accounts.
- Send me a message via Trailblazer Community if you need it to work for millions of records. I’ve got the code for that.
- This does not work for paper letters, but here’s a tutorial on how to do that.
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
- 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!
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.
Set Up Instructions
- BEFORE YOU INSTALL:
- Enable historical trending for opportunities.
- Search for Historical Trending in Setup.
- Search for Opportunity in the search box and select it below.
- Check Enable Historical Trending
- Enable historical trending for opportunities.
- Install in Sandbox org with NPSP.
- 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.
- Add Gifts Last Year custom field to your Contact page layout.
- 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.
- Go to NPSP Settings from App Manager.
- Select Bulk Data Processes.
- Select Rollup Donation Batch.
- Click Run Batch.
- Click on the Setup Icon.
- Search for and select Flows.
- Pick your flow.
- If you want to include the Campaign name in the table, click Year End Tax Flow with Campaign Table.
- If you don’t want to include the Campaign name, click Year End Tax Flow.
- Click Run in the top right corner.
- Your code will now run in batches and you’ll get an email when it’s all 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 Classic 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!
Change Which Gifts are Included
What if you only want to include some gifts that are marked as Tax Deductible or you want to include gifts from this Fiscal year? You’d need to query on a different roll-up field AND possibly add additional criteria. Learn how to modify the apex to work for you here!
- 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.
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
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…
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.
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…