Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. swoosh

swoosh

MITElixirv1.26.3

A comprehensive Elixir library for composing, delivering, and testing emails with support for multiple adapters.

Visit WebsiteGitHubGitHub
1.5k stars257 forks0 contributors

What is swoosh?

Swoosh is an Elixir library that provides a complete solution for sending, composing, and testing emails in Elixir applications. It solves the problem of integrating with various email service providers by offering a unified API with adapters for services like SendGrid, Mailgun, and SMTP, while including first-class testing utilities.

Target Audience

Elixir developers building web applications (especially with Phoenix) that need reliable email delivery, testing, and multi-provider support without vendor lock-in.

Value Proposition

Developers choose Swoosh for its elegant Elixir API, extensive adapter ecosystem, built-in testing tools, and seamless integration with Phoenix and OTP, making email handling both robust and enjoyable.

Overview

Compose, deliver and test your emails easily in Elixir

Use Cases

Best For

  • Adding transactional email (welcome emails, notifications) to Phoenix applications
  • Switching between email service providers (e.g., SendGrid to Postmark) without code changes
  • Testing email flows in unit, integration, and E2E tests with dedicated adapters
  • Previewing emails in development via a built-in browser mailbox
  • Sending emails asynchronously using Elixir's Task or job queues like Oban
  • Handling email attachments from file paths, Plug.Upload, or custom structs

Not Ideal For

  • Applications running on Elixir versions older than 1.16 or OTP older than 26, due to strict version requirements.
  • Teams needing a graphical email builder or WYSIWYG editor integrated directly, as Swoosh focuses on code-based composition.
  • Projects requiring out-of-the-box email analytics dashboards or advanced tracking features, since Swoosh provides telemetry but not a full analytics suite.

Pros & Cons

Pros

Extensive Adapter Support

Includes adapters for over 20 email services like SendGrid, Mailgun, and SMTP, allowing seamless provider switching without code changes, as listed in the README's adapter table.

Functional API Design

Uses a fluent, composable Elixir API for building emails with attachments, HTML/text bodies, and custom headers, aligning with Elixir's functional programming strengths.

Robust Testing Utilities

Provides dedicated adapters for unit tests (Test), async-safe tests (Sandbox), and local development previews, simplifying email testing across different environments.

Telemetry Integration

Emits events for email delivery start, stop, and exceptions, enabling monitoring and debugging in production, as documented in the Telemetry section.

Cons

Manual Async Handling

Lacks built-in async email delivery; developers must implement it manually using Task supervisors or external job queues like Oban, adding boilerplate and potential failure points.

Dependency Management Complexity

Requires additional dependencies for some adapters, such as gen_smtp for SMTP, and careful configuration of HTTP clients, which can complicate setup and maintenance.

Preview Setup Overhead

The mailbox preview feature needs extra configuration, especially in non-Phoenix applications, and may require adding web server dependencies like plug_cowboy or bandit.

Frequently Asked Questions

Quick Stats

Stars1,521
Forks257
Contributors0
Open Issues11
Last commit7 days ago
CreatedSince 2016

Tags

#elixir#phoenix#transactional-email#smtp#mailer#testing#email#hex-package

Built With

P
Plug
F
Finch
E
Elixir
g
gen_smtp
E
Erlang/OTP
B
Bandit
H
Hackney
J
Jason
R
Req
C
Cowboy

Links & Resources

Website

Included in

Elixir13.1k
Auto-fetched 5 hours ago

Related Projects

bamboobamboo

Testable, composable, and adapter based Elixir email library for devs that love piping.

Stars1,956
Forks339
Last commit2 days ago
gen_smtpgen_smtp

The extensible Erlang SMTP client and server library.

Stars714
Forks292
Last commit1 year ago
mailmail

Build composable mail messages

Stars493
Forks72
Last commit4 months ago
mailmanmailman

Mailman provides a clean way of defining mailers in your Elixir applications

Stars204
Forks72
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub