symfony_mailer
The future of this module depends on what happens with the Drupal Core mailer, see #3545439: Future of the Mailer Plus (DSM+) module for details. If you like the features here then please consider putting in a comment in favour of the relevant issues, especially #3380041: Create a new email interface that decorates symfony.
A new mail-system based on the popular Symfony Mailer library giving full support of HTML mails, file attachments, embedded images, 3rd-party delivery integrations, load-balancing/failover, signing/encryption, async sending and more. Other libraries add capability for CSS inlining and HTML to text conversion.
Goals:
- Drop-in replacement with minimal migration steps for the popular swiftmailer module, which became unsupported end Nov 2021.
- Provide improved API and configuration model for sites that are willing to adapt. This module provides a deep integration into Drupal mechanisms, including theme/template/render, multi-language, CSS libraries, configuration, plug-ins, hooks, and logging.
- Allow sites to evolve smoothly from the first to the second.
This module was formally named "Symfony Mailer", then "Drupal Symfony Mailer, then "Drupal Symfony Mailer Plus". It is now simply "Mailer Plus", indicating an enhanced integration of the Symfony Mailer library, which may well continue to exist after Core has provided a simpler integration.
Important information
Please read these pages before using this project as they explain how to get the module working, and what you can expect to work.
- Documentation main page
- Migrating from swiftmailer
- Getting started NB installation instructions
- Supported modules
- Features and status
- Roadmap
- FAQ
Branches
1.x is more stable and compatible with other modules. However it lacks many fixes in 2.x, which will not be backported.
2.x has many fixes and improvements. There are substantial non-backward-compatible API and data-structure changes, which means that custom code will need to be updated (contrib modules that extend this project are recommended to create a new major version). There are update hooks, so the upgrade should work automatically with no custom code. Recommended for sites installing this module for the first time.
Compatibility
This module is not just another mail plug-in – rather it's a full mail system that replaces the one in Drupal Core. We made this choice because the existing MailManager was designed for sending plain text mails using PHP mail and is not well-suited for extension to the many features desired to send modern emails.
The new mail-system offers a new mail interface, which eventually we anticipate that an increasing number of modules will adopt. In the meantime, it also implements the existing interface. This gives a three-level path for support of a sender module that send emails (please follow the links for more details).
- Level 1 – Compoatibility mode. Automatic conversion of emails using the old interface (
hook_mail()andhook_mail_alter()). It's possible to use many of the new features, although with some limitations. - Level 2 – Override mode. A new
EmailBuilderplug-in is used instead of calling the oldhook_mail()interface. This gives almost all of the benefits of this Symfony Mailer – still without changing any sender code. This module includes plug-ins for Drupal core, and an increasing library of other contrib modules. - Level 3 Native implementation. Sender modules can choose to write directly to the new mail-system API, allowing simplified code combined with more flexible and powerful features.
Related modules
- Drupal Symfony Mailer Log log sent emails.
- Symfony Mailer Queue integration with queue systems to asynchronously send emails.
- Symfony Mailer Microsoft Graph extra transport
Similar projects
Drupal Symfony Mailer Lite sends emails using the same approach as the Swiftmailer module. It’s designed to be a direct drop-in replacement for Swiftmailer, maintaining as closely as possible the same features, behaviour and conventions.