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;
* CLI command for sending spooled messages.
*
* @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 init()
parent::init();
$this->mailer = Instance::ensure($this->mailer, Mailer::class);
}
* Sends messages.
public function actionFlush()
$this->mailer->flushQueue();