2017 © Pedro Peláez
 

library mail-queue-bundle

A simple mail queue

image

jlaso/mail-queue-bundle

A simple mail queue

  • Tuesday, January 30, 2018
  • by jlaso
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

========, (*2)

Overview

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

Installation

composer require jlaso/mail-queue-bundle, (*5)

Then register the bundle with your kernel:, (*6)

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new JLaso\MailQueueBundle\MailQueueBundle(),
    // ...
);

Test if works

bin/console jlaso:mail:test mail@example.com 

Setting up the cron

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

Using in a Controller

/** @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)

The Versions

30/01 2018

dev-master

9999999-dev https://github.com/jlaso/MailQueueBundle

A simple mail queue

  Sources   Download

MIT

The Requires

 

mail queue