Keila is an open source alternative to proprietary email marketing tools like Mailchimp and Sendinblue, designed for individuals and teams who want full control over their newsletter data and infrastructure. Built with Elixir and Phoenix, it offers a modern, privacy-respecting platform for sending personalized email campaigns without vendor lock-in. Whether you’re running a small blog newsletter or a large subscriber list, Keila supports SMTP, AWS SES, SendGrid, Mailgun, and Postmark for reliable delivery.
Keila is deployed via Docker and follows the AGPLv3 license, ensuring transparency and community ownership. Its architecture includes a WYSIWYG block editor, Markdown support, MJML integration, and a comprehensive API for automation. All data is stored on your infrastructure, and tracking can be fully disabled for maximum privacy compliance.
What You Get
- Block Editor - A visual, drag-and-drop WYSIWYG editor for designing email templates with reusable content blocks, no coding required.
- Markdown & MJML Support - Write newsletters in plain Markdown or use MJML for responsive, semantic HTML email templates with full design control.
- Liquid Template Engine - Personalize emails using Shopify’s Liquid syntax to dynamically insert custom contact data from forms or external systems.
- Form Builder with Custom Fields - Create sign-up forms with checkboxes, text fields, dropdowns, and conditional logic to collect detailed subscriber data.
- Bot Protection & Double Opt-In - Prevent spam sign-ups with CAPTCHA and enforce double opt-in verification to maintain list quality and deliverability.
- Privacy-First Analytics - Track opens, clicks, and unsubscribes without invasive tracking; option to disable all analytics for GDPR/CCPA compliance.
- Visual Segment Editor - Create targeted email lists using tags, custom fields, or a powerful segment language to send personalized campaigns to subsets of contacts.
- Comprehensive API - Programmatically manage contacts, campaigns, and segments via a RESTful API; includes private beta Zapier integration for no-code workflows.
Common Use Cases
- Running a paid membership newsletter - A journalist uses Keila to publish articles behind a paywall, collect subscriber data via custom forms, and send personalized content using Liquid templates.
- Managing a nonprofit’s donor updates - An NGO self-hosts Keila to send monthly impact reports with embedded donation links, ensuring full data control and compliance with EU privacy laws.
- Automating e-commerce email campaigns - A small business integrates Keila’s API with their Shopify store to send abandoned cart emails using customer purchase data and Liquid variables.
- Publishing a tech blog with MJML templates - A developer uses Keila to design responsive HTML newsletters with MJML, then automates publishing via the API after each blog post is published.
Under The Hood
Architecture
- Modular Elixir architecture with clear separation between domain logic (Keila) and web interface (KeilaWeb), enforced through behaviour contracts like StorageAdapters.Adapter
- Dependency injection via macro-based conditional compilation enables seamless AGPLv3/non-AGPL code differentiation without runtime overhead
- Custom Ecto.Type (JsonField) decouples JSON serialization from application logic, ensuring clean data persistence boundaries
- Phoenix LiveComponent patterns encapsulate file management with reactive state, while template-driven UI components dynamically render features based on build configuration
- Strict separation of concerns ensures file operations, web UI, and business rules remain isolated with no HTTP concerns polluting domain modules
Tech Stack
- Phoenix LiveView backend with Elixir powering real-time, server-rendered interfaces with minimal JavaScript
- TypeScript frontend leveraging ProseMirror and CodeMirror for rich text editing, using established libraries for document modeling and Markdown parsing
- Dprint enforces consistent formatting across TypeScript and JSON files
- SCSS and CSS used for styling, with no heavy frontend frameworks—relying on LiveView for DOM updates
- No traditional database layer; persistence handled via in-memory or file-based storage with Phoenix channels
- Minimal build tooling, relying on Phoenix’s built-in asset pipeline without external bundlers
Code Quality
- Extensive test coverage spanning unit, integration, and end-to-end scenarios with clear tagging and structured assertions
- Strong type safety through Elixir’s pattern matching, guards, and structs, ensuring data integrity at every layer
- Robust error handling using
with statements and structured tuples to manage failures gracefully in email rendering and API flows
- Domain-driven organization cleanly separates mailings, contacts, APIs, and controllers, adhering to Phoenix conventions
- Comprehensive OpenApiSpex documentation auto-generated from route definitions, ensuring backend-frontend contract fidelity
- Consistent naming and modular structure enable clear traceability from HTTP endpoints to domain logic and data storage
What Makes It Unique
- Dynamic code compilation via macros allows dual-licensing (AGPLv3 core + proprietary extensions) within a single codebase without duplication
- Unified email rendering pipeline combines Liquid, Markdown, and inline CSS into a composable system, eliminating external email service dependencies
- Built-in Mjml and Markdown editors with server-side rendering and signature injection create a self-contained email composition environment
- Project-scoped API authorization via Bearer tokens enables multi-tenancy without complex RBAC systems
- Template-driven default content injection with intelligent inheritance reduces user configuration while preserving design consistency
- Client-side UTM/ref parameter capture embedded in registration forms automates marketing attribution without external tracking services