2017 © Pedro Peláez
 

yii2-extension yii2-queue-mailer

Background mailer decorator for Yii2

image

shaqman/yii2-queue-mailer

Background mailer decorator for Yii2

  • Sunday, March 11, 2018
  • by shaqman
  • Repository
  • 2 Watchers
  • 5 Stars
  • 242 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 7 Versions
  • 25 % Grown

The README.md

shaqman/yii2-queue-mailer

Background mailer for Yii2 using any queue interface. This extension was tested with yii2 queue extension., (*1)

This extension was tested only with swiftmailer extension, though it should work with any compatible mailer extension, (*2)

Installation

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

Either run, (*4)

php composer.phar require --prefer-dist shaqman/yii2-queue-mailer

or add, (*5)

"shaqman/yii2-queue-mailer": "*"

Usage

Configure queue component of your application., (*6)

You can find the details here: https://github.com/yiisoft/yii2-queue/, (*7)

Configure \shaqman\mailer\queuemailer\Mailer as your primary mailer., (*8)

  'mailer' => [
      'class' => \shaqman\mailer\queuemailer\Mailer::class,
      'queue' => 'queue' // name of queue component, or a valid array configuration for it.
      'syncMailer' => [ // Any valid mailer should work
          'class' => 'yii\swiftmailer\Mailer',
          'useFileTransport' => true,
      ],
  ],

Now you can send your emails as usual., (*9)

$message = \Yii::$app->mailer->compose()
  ->setSubject('test subject')
  ->setFrom('test@example.org')
  ->setHtmlBody('test body')
  ->setTo('user@example.org')
  ->send($message);

One small difference should be noted compared to the default send. It now returns an int identifying the queue id that the mail was assigned to. This is to be expected since there is no way to know whether the mail was successfully sent at the time of the command was executed., (*10)

The Versions

11/03 2018

dev-master

9999999-dev https://github.com/shaqman/yii2-queue-mailer

Background mailer decorator for Yii2

  Sources   Download

MIT

The Requires

 

by Syakur Rahman

yii2 mailer queue background

11/03 2018

0.3.0

0.3.0.0 https://github.com/shaqman/yii2-queue-mailer

Background mailer decorator for Yii2

  Sources   Download

MIT

The Requires

 

by Syakur Rahman

yii2 mailer queue background

26/09 2017

0.2.2

0.2.2.0 https://github.com/shaqman/yii2-queue-mailer

Background mailer decorator for Yii2

  Sources   Download

MIT

The Requires

 

by Syakur Rahman

yii2 mailer queue background

21/09 2017

0.2.1

0.2.1.0 https://github.com/shaqman/yii2-queue-mailer

Background mailer decorator for Yii2

  Sources   Download

MIT

The Requires

 

by Syakur Rahman

yii2 mailer queue background

21/09 2017

0.2.0

0.2.0.0 https://github.com/shaqman/yii2-queue-mailer

Background mailer decorator for Yii2

  Sources   Download

MIT

The Requires

 

by Syakur Rahman

yii2 mailer queue background

20/09 2017

0.1.1

0.1.1.0 https://github.com/shaqman/yii2-queue-mailer

Background mailer decorator for Yii2

  Sources   Download

MIT

The Requires

 

by Syakur Rahman

yii2 mailer queue background

20/09 2017

0.1.0

0.1.0.0 https://github.com/shaqman/yii2-queue-mailer

Background mailer decorator for Yii2

  Sources   Download

MIT

The Requires

 

by Syakur Rahman

yii2 mailer queue background