- 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.