_baseDomain === null) { $this->_baseDomain = Yii::$app->request->getHostInfo(); if ($this->_baseDomain === null) { throw new InvalidConfigException('Cannot automatically obtain base domain'); } } $this->renderer = new Renderer($this->buildBasePath()); } public function setBaseDomain(string $baseDomain) { $this->_baseDomain = $baseDomain; $this->renderer->setBaseDomain($this->buildBasePath()); } public function getBaseDomain() : string { return $this->_baseDomain; } /** * @param string $templateName * @return TemplateBuilder */ public function getTemplate(string $templateName) : TemplateBuilder { return $this->renderer->getTemplate($templateName); } /** * @param TemplateBuilder $template * @throws \Ely\Email\RendererException * @return string */ public function render(TemplateBuilder $template) : string { return $this->renderer->render($template); } private function buildBasePath() : string { return $this->_baseDomain . $this->basePath; } }