Sending transactional or system emails in SaaS products can be surprisingly painful. Managing SMTP servers, dealing with deliverability issues, and integrating external email services often add friction and complexity. saasmail offers a Cloudflare-native approach to this problem by leveraging Cloudflare Workers, Email Routing, and related edge services, making email sending and routing part of your Cloudflare stack.
What saasmail does and how it works
saasmail is an open-source project written in TypeScript designed to provide a transactional email sending and routing solution tailored for SaaS products. It tightly integrates with Cloudflare’s edge platform, using Cloudflare Workers to run the application logic at the network edge.
Architecturally, it relies on several Cloudflare resources:
- D1: Cloudflare’s serverless SQL database for storing data such as email templates, user preferences, and logs.
- R2: Cloudflare’s object storage for attachments and static assets.
- Queues: For background processing tasks like sending emails asynchronously.
- Email Routing: To handle inbound emails and route them appropriately.
The codebase is TypeScript-based, which is a natural fit given Cloudflare Workers’ JavaScript/TypeScript runtime. saasmail includes integration points to optionally use Resend as an alternative email sending provider instead of Cloudflare Email Sending.
By using Cloudflare’s infrastructure, saasmail positions itself as a serverless-first solution that minimizes infrastructure overhead and scales with the platform.
Technical strengths and tradeoffs
One of saasmail’s standout features is its deep automation integration with Claude Code skills. The repo ships with two Claude Code skills that automate the installation and upgrade process, including Cloudflare resource creation, configuration file setup, migrations, and deployment. This automation is a strong boost to developer experience (DX), reducing manual steps and potential for errors.
The interactive onboarding wizard inside Claude Code walks through complex setup steps such as Cloudflare login, creating D1/R2/Queue resources, configuring wrangler.jsonc and .dev.vars, running database migrations, setting up Email Routing, and deploying Workers. This process, while lengthy (~30-40 minutes mainly due to DNS propagation), is made approachable through guided automation.
The code quality appears pragmatic and clean, focusing on real-world SaaS use cases rather than theoretical purity. The repo’s reliance on Cloudflare’s serverless platform means it inherits platform limitations, including dependency on Cloudflare’s global network and DNS propagation delays when configuring Email Routing.
Another tradeoff is the coupling to Cloudflare’s ecosystem. While this offers a streamlined DX for Cloudflare users, it may not be suitable if you want multi-cloud or vendor-agnostic email infrastructure.
Quick start with Claude Code automation
saasmail provides a recommended installation path using Claude Code, which is a CLI assistant that can run interactive setup skills:
git clone https://github.com/choyiny/saasmail.git
cd saasmail
claude
Within Claude Code, you run the /saasmail-onboarding skill which guides you through:
- Authenticating with Cloudflare
- Creating Cloudflare D1, R2, and Queue resources
- Filling out configuration files
- Running migrations
- Setting up Email Routing for your domain
- Deploying the Worker application
There is also an /update-saasmail skill to sync with upstream changes and handle conflicts smoothly.
For those without Claude Code, manual steps are documented to clone, install dependencies, authenticate with Cloudflare, and manually create resources and configure the project.
Verdict
saasmail is a solid option if you are building SaaS on Cloudflare’s edge platform and want a transactional email solution that fits naturally into your existing Cloudflare infrastructure. The integration with Cloudflare Workers, D1, R2, and Email Routing is practical and reduces external dependencies.
The main limitation is the tight coupling to Cloudflare’s ecosystem and the latency introduced by DNS propagation during setup. Also, the reliance on Claude Code skills for smooth onboarding is great if you use Claude Code but could be a barrier otherwise.
Overall, saasmail is worth exploring for developers who want to consolidate email sending and routing within Cloudflare, appreciate serverless-first architecture, and value automation that reduces setup complexity. It’s less relevant if you prefer a multi-cloud or cloud-agnostic approach or need enterprise-grade email features beyond what Cloudflare provides.
The repo is well-documented and the codebase straightforward enough to adapt or extend if needed. Worth understanding even if you don’t adopt it outright, especially to see how Cloudflare’s edge platform can be harnessed for SaaS infrastructure components.
→ GitHub Repo: choyiny/saasmail ⭐ 154 · TypeScript