public function getTemplate($key, $language = null, $default = null)
    {
        /* @var EmailTemplate $template */
        $template = $this->repository->getByKeyWithTranslation(
            $key,
            $language ?: Yii::$app->language
        );

        return empty($template->translations[0])
            ? $default
            : EmailTemplate::buildFromEntity($template->translations[0]);
    }
public function getTemplate($key, $language = null, $default = null)
    {
        /* @var EmailTemplate $template */
        $template = $this->repository->getByKeyWithTranslation(
            $key,
            $language ?: Yii::$app->language
        );

        return empty($template->translations[0])
            ? $default
            : EmailTemplate::buildFromEntity($template->translations[0]);
    }
public function getTemplate ( $ key , $ language = null , $ default = null ) { /* @var EmailTemplate $template */ $ template = $ this -> repository -> getByKeyWithTranslation ( $ key , $ language ? : Yii :: $ app -> language ) ; return empty ( $ template -> translations [ 0 ] ) ? $ default : EmailTemplate :: buildFromEntity ( $ template -> translations [ 0 ] ) ; }
Returns template model by key and language.

@see EmailTemplateModel

@param string        $key
@param null|string   $language   Template language.
@param mixed         $default    Default value.

@return null|EmailTemplate
Returns template model by key and language .