dev-master
9999999-dev https://github.com/jlaso/MailQueueBundleA simple mail queue
MIT
The Requires
- php >=5.6.0
- predis/predis *
mail queue
Wallogit.com
2017 © Pedro Peláez
A simple mail queue
========, (*2)
This bundle handles a mail queue, (*3)
In order to install this bundle you need to pay attention with requirements:, (*4)
php >= 5.6 redis >= 1.0
composer require jlaso/mail-queue-bundle, (*5)
Then register the bundle with your kernel:, (*6)
// in AppKernel::registerBundles()
$bundles = array(
// ...
new JLaso\MailQueueBundle\MailQueueBundle(),
// ...
);
bin/console jlaso:mail:test mail@example.com
crontab -e to add more jobs to the cron list, (*7)
* * * * * php /path/to/your/project/bin/console jlaso:mail-queue:process --env=prod >> /var/log/mail-queue.log
/** @var MailQueueService $mailQueueService */
$mailQueueService = $this->get('jlaso_mail_queue_service');
$mailQueueService->queueMail(
'sender@example.com',
'dest@example.com,
'This a test email',
'The body of the email comes here'
);
Remember that the instructions above don't send actually the mail. We are just queueing the mail, the cron will process pending mails in the next round., (*8)
A simple mail queue
MIT
mail queue