for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link https://github.com/Izumi-kun/yii2-spoolmailer
* @copyright Copyright (c) 2017 Viktor Khokhryakov
* @license http://opensource.org/licenses/BSD-3-Clause
*/
namespace izumi\spoolmailer;
use yii\console\Controller;
use yii\di\Instance;
* MailController
*
* @author Viktor Khokhryakov <[email protected]>
class MailController extends Controller
{
public $defaultAction = 'flush';
* @var Mailer|array|string the mailer object or the application component ID of the mailer object.
public $mailer = 'mailer';
* @inheritdoc
public function beforeAction($action)
if (!parent::beforeAction($action)) {
return false;
}
$this->mailer = Instance::ensure($this->mailer, Mailer::class);
return true;
* Sends messages.
public function actionFlush()
$this->mailer->flushQueue();