Our nonprofit needed a cheaper way to send email blasts. So we engineered one.

Email marketing is a critical tool for nonprofits to engage supporters, drive donations, promote events, and share impact stories. However, the costs of using commercial email platforms can quickly eat into a nonprofit‘s limited budget, especially as email lists grow.

At our education nonprofit, we were spending upwards of $1,000 per month on email service provider (ESP) fees. As our subscriber base grew past 100,000 contacts, we realized it was time to reevaluate our approach. We needed a solution that would allow us to send high volumes of email at a lower cost, without sacrificing deliverability or functionality.

After researching the options, we decided to build our own email platform using open source tools and cloud infrastructure. The result is Mail for Good, a free email marketing system for nonprofits. In this post, I‘ll share why we built Mail for Good, how it works, and the impact it‘s having for mission-driven organizations around the world.

The High Costs of Email Marketing

Most commercial ESPs charge based on the number of subscribers stored in your account, regardless of how many emails you actually send. The tiers are usually divided into buckets of 10,000 contacts each, with costs increasing as you move up.

To quantify the expense, here‘s a comparison of several popular email platforms and their monthly fees for storing a list of 100,000 subscribers:

ESP Monthly Cost
Mailchimp $1,150
Campaign Monitor $999
Constant Contact $530
AWeber $500
GetResponse $450

Keep in mind these prices typically only include list storage and a limited number of email sends. Most providers charge extra for transactional emails, automation, or advanced features like A/B testing and dynamic content.

At the volume our nonprofit operates at, sending 2-3 email blasts per week, we were easily spending $12,000 to $15,000 per year on email fees. That‘s a significant expense that could be redirected towards programs and initiatives that directly further our mission. We knew there had to be a better way.

The Power of Open Source

As a nonprofit, we‘re big believers in the power of open source. Using community-developed tools allows us to keep costs low while still accessing powerful functionality. Many open source projects also have strong communities behind them, providing support, documentation, and ongoing development.

When we started researching alternatives for our email needs, we were drawn to solutions built on open frameworks and libraries. There are existing open source email projects like Mautic and Sendy, but none met the specific requirements we had in mind:

  • Easy for non-technical users to create and send email campaigns
  • Powerful segmentation and personalization features
  • Embeddable subscription forms to grow our list
  • No-fuss unsubscribe and compliance functionality
  • Detailed analytics and engagement reporting
  • Unlimited users with role-based access control
  • Bulk contact importing and exporting
  • RESTful API for extending and integrating
  • Modern, mobile-friendly responsive templates

To get exactly what we needed, we decided to build our own email system from the ground up. We would leverage open source technologies for the heavy lifting, while creating a user-friendly interface tailored for nonprofits.

Our Open Source Email Architecture

Here‘s a high-level overview of the Mail for Good architecture:

Mail for Good Architecture Diagram

Let‘s break down the key components:

  • React Frontend – The Mail for Good web app is a single-page application (SPA) built with React. It provides the user interface for managing contacts, creating email campaigns, viewing reports, and changing settings.

  • Node.js Backend – The backend API is powered by Node.js and Express. It handles authentication, database queries, email sending, and analytics tracking. We chose Node for its performance, scalability, and extensive package ecosystem.

  • MongoDB Database – Subscriber data, email templates, and app settings are stored in MongoDB. We use Mongoose for schema management and as an ODM layer. MongoDB‘s flexible document model is a good fit for the varying structures of subscriber records and email content.

  • Redis Cache – To speed up common queries and reduce hits to MongoDB, we use Redis as an in-memory cache. It also powers rate limiting and tracks ephemeral analytics data.

  • Background Workers – Sending emails is handled asynchronously by a pool of background worker processes. These workers pull jobs from a Redis queue and make calls to the Amazon SES API to deliver the emails.

  • Amazon SES – For the actual email sending, we use Amazon‘s Simple Email Service (SES). SES provides a reliable and scalable infrastructure for sending bulk email. It also handles DKIM signing, spam complaints, bounces, and unsubscribes.

By leveraging open source libraries and cloud services, we‘re able to achieve high levels of performance and deliverability at a fraction of the cost of commercial ESPs. Let‘s take a closer look at the delivery pipeline.

Sending Emails with Amazon SES

When a user creates a new email campaign in Mail for Good, the React app makes a POST request to the Node API with the campaign details. The API creates a new campaign record in MongoDB and adds the individual recipient emails to a Redis queue.

From there, the background worker processes take over:

  1. A worker pulls the next batch of emails from the queue
  2. For each email:
    • Render the template with personalized merge fields
    • Make a request to the SES API to send the email
    • Handle any bounces or complaints synchronously
    • Log the email send and track analytics in MongoDB
  3. Once all emails are sent, update the campaign status

Using a queue and worker pool allows Mail for Good to process large email blasts efficiently. SES endpoints have a maximum sending rate of 10 emails per second, but the workers can easily scale to deliver millions of emails per hour by spreading the load.

We also built in retry logic and error handling to ensure high deliverability rates. If an email fails to send due to a temporary SES issue, the worker will automatically retry the send several times before marking it as failed.

Cost Savings and ROI

By self-hosting Mail for Good and sending through SES, we‘ve reduced our email costs by over 90% compared to commercial ESPs. Here‘s a cost breakdown for sending to a list of 100,000 subscribers:

Commercial ESP Mail for Good + SES
Monthly Fee $500 – $1,150 $0
CPM (Cost per 1,000 emails) Included in monthly fee $0.10
Total Cost for 1 Campaign $500 – $1,150 $10
Total Cost for 1 Year (50 campaigns) $6,000 – $13,800 $500

As you can see, the cost difference is significant. Even with the additional overhead of hosting Mail for Good ourselves, we‘re saving thousands of dollars per year.

But the benefits go beyond just cost savings. Because Mail for Good is open source, we have complete control and ownership over our email data. We‘re not locked into a particular vendor or beholden to their pricing tiers and limitations. And as the project grows, we‘ll benefit from community contributions and the ability to steer future development.

Empowering Other Nonprofits

We knew from the start that we wanted to share Mail for Good with other nonprofits. Email is such a critical tool for engaging supporters and driving donations, but the costs can be prohibitive for smaller organizations.

By open sourcing the code and providing detailed documentation, our goal is to enable any nonprofit to run their own email marketing at a drastically lower cost. And as more organizations adopt Mail for Good, the system will continue to improve through community feedback and contributions.

We‘ve already seen incredible interest and adoption from nonprofits around the world. Some highlights:

  • A disaster relief organization using Mail for Good to coordinate volunteers and solicit donations
  • A health research foundation sending millions of emails to study participants
  • An environmental advocacy group using Mail for Good‘s segmentation tools to target supporters by location and issue interest
  • A network of schools using Mail for Good to send newsletters and announcements to parents and students

By open sourcing Mail for Good, we‘ve turned email from a cost center into an asset for the nonprofit ecosystem. And we‘re just getting started.

Getting Started with Mail for Good

Interested in using Mail for Good for your own nonprofit? The code is available on GitHub under the permissive MIT license: https://github.com/freecodecamp/mail-for-good

To get started, you‘ll need to deploy the app to a cloud platform like AWS, Google Cloud, or Heroku. We provide detailed deployment guides in the repository wiki, with step-by-step instructions for provisioning servers, configuring DNS, and setting up the environment.

Deploying Mail for Good does require some technical know-how, but a reasonably skilled developer should be able to get it up and running in a few hours. If you need help, our community is available to answer questions and provide support.

Once deployed, using Mail for Good is straightforward. The app walks you through connecting your SES account, creating email templates, importing contacts, and launching your first campaign. You can also configure settings like your unsubscribe URL, default from address, and authentication domain.

The Future of Mail for Good

We have big plans for Mail for Good in the coming year. Some of the key initiatives on our roadmap:

  • Localization into multiple languages for broader accessibility
  • Drag-and-drop email template editing
  • Deeper CRM integrations for additional personalization
  • A/B testing and automated send time optimization
  • Mobile apps for on-the-go campaign management
  • Plug-and-play integrations with other nonprofit tools

We‘ll also continue to refine the performance and scalability of the core platform. Our goal is to make Mail for Good the best email tool for nonprofits, no matter the size of their email list.

Of course, as an open source project, the future of Mail for Good will be shaped by its community. We welcome contributions from developers, designers, and email marketers who share our vision for empowering nonprofits. Whether it‘s submitting a pull request, designing a new template, or sharing your success story, there are many ways to get involved.

Driving Impact Through Open Source

At the end of the day, Mail for Good is about impact. By providing nonprofits with a cost-effective, powerful, and open email platform, we enable them to engage more supporters and drive more donations. More resources can be directed towards programs and services, not overhead and administrative costs.

But Mail for Good is just one example of how open source can be a force for social good. When mission-driven organizations collaborate on shared tooling and infrastructure, everyone benefits. It‘s a rising tide that lifts all boats.

As a nonprofit ourselves, we understand the challenges and constraints that come with tight budgets and limited resources. We also know firsthand the impact that engaged supporters and grassroots funding can have. Mail for Good is our attempt to pay it forward and build a stronger nonprofit sector, one email at a time.

If you‘re a nonprofit looking to up your email game, we invite you to give Mail for Good a try. And if you‘re a developer or designer looking to make a difference, we invite you to join our community and contribute your skills to a worthy cause.

Together, we can change the world, one inbox at a time.

Similar Posts