public function sendEmail(\yii\base\Model $model, $mode)
    {
        $params = [
            'siteUrl' => \yii\helpers\Url::toRoute(['/'], true),
        ];
        switch ($mode) {
            default:
                return false;
            case 'recovery':
            case 'verify':
                $subject = $mode == 'recovery'
                    ? Yii::t('usr', 'Password recovery')
                    : Yii::t('usr', 'Email address verification');
                $params['actionUrl'] = \yii\helpers\Url::toRoute([
                    $this->module->id . '/default/' . $mode,
                    'activationKey' => $model->getIdentity()->getActivationKey(),
                    'username'      => $model->getIdentity()->username,
                ], true);
                break;
            case 'oneTimePassword':
                $subject        = Yii::t('usr', 'One Time Password');
                $params['code'] = $model->getNewCode();
                break;
        }
        $message = Yii::$app->mailer->compose($mode, $params);
        $message->setTo([$model->getIdentity()->getEmail() => $model->getIdentity()->username]);
        $message->setSubject($subject);

        return $message->send();
    }