2017 © Pedro Peláez
 

yii2-extension yii2-queue-mails

Queue mails

image

vision/yii2-queue-mails

Queue mails

  • Thursday, December 24, 2015
  • by visionp
  • Repository
  • 1 Watchers
  • 1 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

QueueMails

Installation

The preferred way to install this extension is through composer., (*1)

Either run, (*2)

php composer.phar require --prefer-dist vision/yii2-private-messages "@dev"

or add to the require section of your composer.json file., (*3)

"vision/yii2-queue-mails":"~1.0.0"

Configuration

Once the extension is installed, add following code to your application configuration :, (*4)

'mailer' => [ 'class' => 'vision\queue_mails\Mailer', 'mailsPerRound' => 5, 'realMailer' => [ 'class' => '****', 'apikey' => '*****' ] ],, (*5)

and /config/console.php:, (*6)

'mailer' => [ 'class' => 'vision\queue_mails\Mailer', 'mailsPerRound' => 5, 'realMailer' => [ 'class' => '****', 'apikey' => '*****' ] ],, (*7)

Following properties are available for customizing the mail queue behavior., (*8)

mailsPerRound: Number of emails to send at a time., (*9)

Run yii migrate command in command line:, (*10)

php yii migrate --migrationPath=@vendor/vision/yii2-queue-mails/migrations, (*11)

Most preferably this could be a console command (eg: mail/send) which can be triggered by a CRON job.

Setting the CRON job, (*12)

Set a CRON job to run console command:, (*13)

*/10 * * * * php /var/www/html/myapp/yii mail/send, (*14)

Usage

Yii::$app->mailer->compose('contact/html', ['contactForm' => $form]) ->setFrom('from@domain.com') ->setTo($form->email) ->setSubject($form->subject) ->send();, (*15)

Processing the mail queue

Now calling Yii::$app->mailqueue->process() will process the message queue and send out the emails., (*16)

The Versions

24/12 2015

dev-master

9999999-dev

Queue mails

  Sources   Download

MIT

The Requires

 

by Aleksandr Petrenko

email extension yii2 queue mails

23/12 2015

dev-dev

dev-dev

Queue mails

  Sources   Download

MIT

The Requires

 

by Aleksandr Petrenko

email extension yii2 queue mails

23/12 2015

1

1.0.0.0

Queue mails

  Sources   Download

MIT

The Requires

 

by Aleksandr Petrenko

email extension yii2 queue mails