Drupal is a registered trademark of Dries Buytaert

symfony_mailer_queue

187 sites Security covered
View on drupal.org

The Symfony Mailer Queue module extends the existing Drupal Symfony Mailer Plus module by integrating with queue systems to asynchronously send emails.

This enhancement ensures that email delivery is handled asynchronously, significantly improving the performance and reliability of your Drupal site. By utilizing Drupal’s queue system, the module processes email-sending tasks in the background, allowing for better resource management and scalability.

Features

  • Seamless Integration: It utilizes the existing Drupal Symfony Mailer plugin system and works out of the box with the Drupal database queue.
  • Queue System: Emails are added to a queue and processed asynchronously, ensuring quick response times for web requests.
  • Email Adjuster Configuration: Easy-to-use configuration interface for managing individual queue settings.
  • Event System: Dispatches requeue and failure events for other modules to subscribe to.

How to use?

  1. Installation: Start by installing the module via Composer. The module depends on Drupal Symfony Mailer.
  2. Configure Mailer Policies: Go to Configuration > System > Mailer and add the Queue sending email adjuster to the desired policies. Configure the queue behavior, requeue delay, maximum retry attempts, and wait time per item.
  3. (Optional) Configure Ultimate Cron: If processing the queue with cron, it is recommended to schedule frequent cron processing. This can be achieved with the Ultimate Cron module. There are two jobs to consider:
    • The Default cron handler of Symfony Mailer Queue performs garbage collection required to release queue items.
    • The Queue of Symfony Mailer Queue, which sends emails and retries failures.

You can find more details in the blog post Drupal: Asynchronously send emails with Symfony Mailer Queue.

Queue Behaviors

When email processing fails, one may choose between different queue behaviors.

  • Delayed requeue: If requeuing is delayed, the item will only be available after the specified delay or once its lease time expires. While not all queue systems support delays, the Drupal database queue does. Proper garbage collection must be configured to release items when using cron to process the queue. For queues that do not support delays, a default lease time of one minute applies.
  • Immediate requeue: Items that are immediately requeued become available for repeated processing right away. They might even be picked up within the same queue run.
  • Suspend queue: The email queue can be suspended, which requeues the failed item and delays the processing of other items until the next scheduled queue run.

Developer Notes

  • When using delayed requeuing, the queue which processes items is required to implement the DelayableQueueInterface.
  • The item expiry reset may be performed during cron. In that case, the queue must implement the QueueGarbageCollectionInterface.
  • Other modules can subscribe to the EmailSendRequeueEvent and EmailSendFailureEvent events to react with logging or further processing. Read this blog post about the Drupal event system.
  • There is a lot of movement around the mailer setup in Drupal. See the meta issue about including Symfony Mailer in Drupal core. Or the excellent blog series about more advanced setups with Symfony Messenger.

Similar projects

If your website relies on the traditional PHP mailer, explore the Queue Mail or Mail Entity Queue modules.

Activity

Total releases
6
First release
Jun 2025
Latest release
3 weeks ago
Release cadence
50 days
Stability
33% stable

Release Timeline

Releases

Version Type Release date
1.2.1 Stable Feb 9, 2026
1.2.0 Stable Jul 2, 2025
1.2.0-rc1 Pre-release Jun 26, 2025
1.2.0-beta1 Pre-release Jun 9, 2025
1.2.0-alpha1 Pre-release Jun 6, 2025
1.2.x-dev Dev Jun 6, 2025