A comprehensive Elixir library for composing, delivering, and testing emails with support for multiple adapters.
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.
Elixir developers building web applications (especially with Phoenix) that need reliable email delivery, testing, and multi-provider support without vendor lock-in.
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.
Compose, deliver and test your emails easily in Elixir
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
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.
Uses a fluent, composable Elixir API for building emails with attachments, HTML/text bodies, and custom headers, aligning with Elixir's functional programming strengths.
Provides dedicated adapters for unit tests (Test), async-safe tests (Sandbox), and local development previews, simplifying email testing across different environments.
Emits events for email delivery start, stop, and exceptions, enabling monitoring and debugging in production, as documented in the Telemetry section.
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.
Requires additional dependencies for some adapters, such as gen_smtp for SMTP, and careful configuration of HTTP clients, which can complicate setup and maintenance.
The mailbox preview feature needs extra configuration, especially in non-Phoenix applications, and may require adding web server dependencies like plug_cowboy or bandit.