private function createMailTemplate(string $mailKey, array $mailVars = [])
    {

        /**
         * @var $mailTemplate Template
         */
        $mailTemplate = \Yii::$app->get('emailTemplates')
            ->getTemplate($mailKey, Language::getCurrent()->id);
        if (!empty($mailVars) && !empty($mailTemplate)) {
            $mailTemplate->parseSubject($mailVars);
            $mailTemplate->parseBody($mailVars);
        }

        return $mailTemplate;
    }
private function createMailTemplate(string $mailKey, array $mailVars = [])
    {

        /**
         * @var $mailTemplate Template
         */
        $mailTemplate = \Yii::$app->get('emailTemplates')
            ->getTemplate($mailKey, Language::getCurrent()->id);
        if (!empty($mailVars) && !empty($mailTemplate)) {
            $mailTemplate->parseSubject($mailVars);
            $mailTemplate->parseBody($mailVars);
        }

        return $mailTemplate;
    }
private function createMailTemplate ( string $ mailKey , array $ mailVars = [ ] ) { /**
         * @var $mailTemplate Template
         */ $ mailTemplate = \ Yii :: $ app -> get ( 'emailTemplates' ) -> getTemplate ( $ mailKey , Language :: getCurrent ( ) -> id ) ; if ( ! empty ( $ mailVars ) && ! empty ( $ mailTemplate ) ) { $ mailTemplate -> parseSubject ( $ mailVars ) ; $ mailTemplate -> parseBody ( $ mailVars ) ; } return $ mailTemplate ; }
Uses emailTemplates component which parses variables
and inserts values to email subject and body
@param string $mailKey
@param array $mailVars
@return mixed
Uses emailTemplates component which parses variables and inserts values to email subject and body