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]);
    }