<?php
/**
 * Created by PhpStorm.
 * User: andri
 * Date: 26.10.17
 * Time: 12:39
 */

namespace app\controllers;


use dektrium\user\controllers\AdminController as BaseAdminConteroler;
use Yii;
use dektrium\user\Mailer;
use yii\helpers\Url;


class AdminController extends BaseAdminConteroler
{

    public function actionSend($id)
    {
        $model = $this->findModel($id);
        //$mailer = Yii::createObject(Mailer::className());
        $mailer = Yii::$container->get(Mailer::className());
        $mailer->sendMessage($model->email, Yii::t('app','ActivationSubject ID'), 'confirmation');

        return $this->redirect(Url::previous('actions-redirect'));
    }

}