Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Swiftmailer Enqueue Bundle

Swiftmailer Enqueue Bundle Laravel Package

dnna/swiftmailer-enqueue-bundle

Symfony bundle that spools SwiftMailer emails to an Enqueue message queue and consumes them via swiftmailer:spool:send. Adds configurable queue options, receive timeouts, graceful shutdown via signal extension, and optional requeue/retry handling.

View on GitHub
Deep Wiki
Context7

Swiftmailer Spool using the Enqueue message queue

Frequently asked questions about Swiftmailer Enqueue Bundle
Can I use this bundle in a pure Laravel project without Symfony dependencies?
No, this bundle is Symfony-centric and requires Symfony’s Kernel and Bundle system. For Laravel, you’d need to manually bridge components (e.g., wrap Swiftmailer and Enqueue in a Laravel service provider) or adopt Symfony’s HttpClient/Console. The blocking `swiftmailer:spool:send` command also clashes with Laravel’s async workflows, requiring redesign.
What Laravel versions does this package support?
This bundle is designed for Symfony, not Laravel, but may work in Laravel 8+ if you integrate Symfony’s Mailer or Messenger components. The last update was in 2021, so compatibility with newer Laravel versions (e.g., 10+) isn’t guaranteed. Test thoroughly or fork the package for updates.
How do I configure Enqueue for Redis instead of RabbitMQ?
Install the Redis extension for Enqueue (`composer require enqueue/redis-ext php-redis`), then configure the transport in `config/packages/enqueue.yaml` to use Redis (e.g., `dsn: redis://localhost`). The bundle’s `service_id` in `dnna_swiftmailer_enqueue.yaml` should point to your Redis transport context.
Does this bundle work with Laravel’s Mail facade or only Swiftmailer?
This bundle assumes Swiftmailer as the transport. If using Laravel’s Mail facade, create middleware to delegate to Swiftmailer (e.g., `Mail::extend('swift', fn($app) => new Swift_Mailer(...))`). Alternatively, use Laravel’s native queueable mail (e.g., `spatie/laravel-queueable-mail`) to avoid Symfony coupling.
What’s the impact of the blocking `swiftmailer:spool:send` command in Laravel?
The command blocks until messages are processed or timeouts occur, which conflicts with Laravel’s async queues (e.g., Horizon). Mitigate this by running the command in a separate process (e.g., daemonized worker) or use Laravel’s queue workers to consume Enqueue messages instead of the Symfony command.
How do I handle email failures with retries?
Configure `max_requeue_attempts` (default: 5) in `dnna_swiftmailer_enqueue.yaml` to control retry attempts. For production, extend the logic to use dead-letter queues (e.g., via Enqueue’s `ErrorStrategy`) or integrate with Laravel’s failed job system for custom handling.
Is this bundle actively maintained? What if I need fixes?
The last release was in 2021 with no recent updates. If issues arise, fork the repository or check for community forks. Critical features (e.g., Enqueue integration) can be extracted and rewritten as standalone Laravel packages to avoid dependency risks.
What are the alternatives for Laravel email queuing?
For Laravel-native solutions, consider `spatie/laravel-queueable-mail` (integrates with Laravel’s queues) or `laravel-horizon` (for queue monitoring). If you need Swiftmailer specifically, evaluate `symfony/mailer` with Laravel’s service container or build a custom Enqueue spool without Symfony’s bundle system.
How do I set up graceful shutdowns for email processing?
Enable the `signal_extension` in `dnna_swiftmailer_enqueue.yaml` to handle shutdown signals (e.g., SIGTERM). This ensures pending emails are processed before the worker exits. For Laravel, combine this with queue workers or supervisor configs to manage process lifecycle.
What’s the performance impact of using Enqueue vs. Laravel’s native queues?
Enqueue adds overhead for message serialization/deserialization and transport-specific latency (e.g., Redis/RabbitMQ). For high-volume email systems, Enqueue’s persistence and retry logic may justify the cost, but benchmark against Laravel’s queue drivers (e.g., `database`, `redis`) to compare throughput and resource usage.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours