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.
This is a symfony bundle that allows using an Enqueue message queue to spool and consume messages.
Basically an implementation of https://blog.forma-pro.com/spool-swiftmailer-emails-to-real-message-queue-9ecb8b53b5de with extra features like graceful shutdowns and other customization options.
Open a command console, enter your project directory and execute:
$ composer require dnna/swiftmailer-enqueue-bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require dnna/swiftmailer-enqueue-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php file of your project:
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Enqueue\Bundle\EnqueueBundle(),
new Dnna\SwiftmailerEnqueueBundle\SwiftmailerEnqueueBundle(),
);
// ...
}
// ...
}
Below is the configuration reference for this bundle:
dnna_swiftmailer_enqueue:
queue:
service_id: enqueue.transport.default.context
key: swiftmailer_spool
requeue_on_exception: false
max_requeue_attempts: 5
consumption:
receive_timeout: 1000
extensions:
signal_extension: true
All parameters are optional and if not set will use the default values.
Warning: Installing this bundle changes swiftmailer:spool:send into a blocking command.
This means it will not exit until the time or message limit specified has been reached.
If no limits are specified the command will never exit.
How can I help you explore Laravel packages today?