{@inheritdoc}

If the expected message has been set, the message template will be used.

@return TemplateInterface
763760
public function getTemplate()
    {
        if ($this->expectedMessage) {
            return $this->getMessageTemplate();
        }

        if (!isset($this->template)) {
            return $this->getDefaultTemplate();
        }

        return $this->template;
    }
960394
public function getTemplateEngine()
    {
        if (null == $this->templateEngine) {
            Template::addPath(dirname(dirname(__DIR__)).'/templates');
            $template = (new Template())->initialize();
            $this->setTemplateEngine($template);
        }
        return $this->templateEngine;
    }
403436
public function prepare(ContentInterface $content, ThemeInterface $theme, $templateTypeName = null)
    {
        $this->contextStack->push(
            $this->contextBuilder
                ->setContent($content)
                ->setTheme($theme)
                ->setTemplateTypeName($templateTypeName)
            ->createContext()
        );

        return $this;
    }
674536
public function textTemplate($template, $data=[]) {
		$data['message'] = $this;
		$res = $this->buildTemplate($template, $data);
		return $this->text($res);
	}
1372167
public function resolveTemplate()
    {
        if (strpos($this->template, '*') !== false) {
            return str_replace('*', $this->getTheme(), $this->template);
        }
        return $this->template;
    }
1139091
public function setTemplate($templateName)
    {
    	if($templateName instanceof MailTemplate)
    	{
    		$this->template = $templateName;
    	}
    	elseif (!$this->template = $this->mailerManager->getRepository()->findOneBy(array('name' => $templateName)))
    	{
    		$this->template =  $this->mailerManager->createDefault($templateName);
    	}
    
    	return $this;
    }
183875
public function setTemplate($template)
    {
        if(!$template instanceof TemplateInterface)
        {
            if(empty($template) || (is_string($template) && strpos($template, '.') === false) )
            {
                $identifier         = $this->getIdentifier()->toArray();
                $identifier['path'] = array('template');
                $identifier['name'] = $template;

                $identifier = $this->getIdentifier($identifier);
            }
            else $identifier = $this->getIdentifier($template);

            $template = $identifier;
        }

        $this->__template = $template;

        return $this->__template;
    }
73817
public function setTemplate($template)
    {
        if (is_string($template)) {
            $template = new TemplateView($template);
        }
        $template->mergeData([
            'layout' => $this
        ]);
        $this->addChild(new Part($template, 'template'));
        return $this;
    }
1257446
public function getTemplate() : ?string 
    {
        if ( ! $this->hasTemplate()) {
            $this->setTemplate($this->getDefaultTemplate());
        }
        return $this->template;
    }
971868
public function getTemplate()
    {
        if(!$this->__template instanceof KTemplateInterface)
        {
            if(empty($this->__template) || (is_string($this->__template) && strpos($this->__template, '.') === false) )
            {
                $identifier         = $this->getIdentifier()->toArray();
                $identifier['path'] = array('template');
                $identifier['name'] = $this->__template;
            }
            else $identifier = $this->getIdentifier($this->__template);

            $this->__template = $this->getObject($identifier);
        }

        return $this->__template;
    }
719822
public function setTemplateId(string $templateId = null)
    {
        if (!$this->setHeaderFieldModel('TemplateID', $templateId)) {
            $this->getHeaders()->addTextHeader('TemplateID', $templateId);
        }

        return $this;
    }
934196
public function setTemplate($template)
    {
        $layout = $this->getViewModel();
        $layout->setTemplate((string) $template);

        return $this;
    }
559235
public function htmlTemplate($template, $data=[]) {
		$data['message'] = $this;
		$res = $this->buildTemplate($template, $data);
		return $this->html($res);
	}
899433
protected function getLayout(TemplateInterface $template)
    {
        $layout = new Template($this->getThemeLayoutTemplate());

        $layout->setVar('content', $template->render());
        $layout->setVar('meta', Config::getInstance()->get('Eureka\Global\Meta'));

        return $layout;
    }
591287
protected function _getTemplate()
    {
        if (is_null($this->_template)) {
            foreach ($this->_map as $method => $className) {
                if ($this->_sql instanceof $className) {
                    $this->_template = $this->$method();
                    break;
                }
            }
        }
        return $this->_template;
    }
336174
public function getTemplate()
    {
        if ($this->templateEngine == false) {
            return false;
        }
        
        $this->view->setTwigEnvironment();

        return $this->view->getTemplate();
    }
383457
public function addMessage($template)
    {
        $arguments = func_get_args();
        $key = null;
        $template = $arguments[0];
        if (array_key_exists($template, $this->_messageTemplates)) {
            $key = $template;
            $template = $this->_messageTemplates[$template];
        }
        $arguments[0] = $template;
        if (sizeof($arguments) > 1) {
            $this->_messages[$key] = call_user_func_array('sprintf', $arguments);
        } else {
            $this->_messages[$key] = $template;
        }
        return $this;
    }