@param $templateId

@return \Magento\Email\Model\Template
359526
private function loadTemplate($templateId)
    {
        $template = $this->templateFactory->create();
        $this->templateResource->load($template, $templateId);

        return $template;
    }
72336
public function render(TemplateView $view)
    {
        $content = $this->twig->render($view->getTemplate(), $view->getContext()->toArray());

        $response = new TemplateResponse($view->getTemplate(), $view->getContext(), $content);

        return $response;
    }
1205237
public function createSurveyFromTemplate($templateId, array $data = [])
	{
		return $this->sendRequest(
			$this->createRequest('POST', 'surveys', [], array_merge($data, [ 'from_template_id' => $templateId ]))
		);
	}
159610
public function setTemplateFile(string $templateFile)
    {
        if (!$templateFile) {
            return $this;
        }
        $this->templateFile = (string) $templateFile;

        return $this;
    }
284696
public function setTemplateData(array $templateData)
    {
        if (!isset($this->templateData)) {
            $this->templateData = [];
        }

        $this->templateData = array_merge($this->templateData, $templateData);

        return $this;
    }
37882
public function templatePath($templatePath = false)
    {
        if ($templatePath === false) {
            return $this->_templatePath;
        }

        $this->_templatePath = $templatePath;

        return $this;
    }
971766
public function listTemplates( $templateType = null ){
        $queryParams = is_null( $templateType ) ? [] : [ 'type' => $templateType ];
        return $this->httpGet( self::PATH_TEMPLATE_LIST, $queryParams );
    }
732036
public function apply(&$templateString) {

		$application	= Application::getInstance();
		$config			= $application->getConfig();

		$locale = $application->getCurrentLocale();

		// without locale replace placeholders with their identifier

		if(empty($locale)) {

			$templateString = preg_replace(
				array(
					'@\{![a-z0-9_]+\}@i',
					'@\{![a-z0-9_]+:(.*?)\}@i'
				),
				array(
					'',
					'$1'
				),
				$templateString
			);
			return;

		}

		$this->getPhrases($locale);

		$templateString = preg_replace_callback(
			'@\{!([a-z0-9_]+)(:(.*?))?\}@i',
			array($this, 'translatePhraseCallback'),
			$templateString
		);
	}
719822
public function setTemplateId(string $templateId = null)
    {
        if (!$this->setHeaderFieldModel('TemplateID', $templateId)) {
            $this->getHeaders()->addTextHeader('TemplateID', $templateId);
        }

        return $this;
    }
21890
public static function renderThemeTemplate($target, $templateId, $data = array()){

        //search in the registry to get the custom template to render
        $tpl = self::getThemeTemplate($target, $templateId);
        $theme = self::getCurrentTheme();

        if(!is_null($tpl)){
            if ($theme instanceof ConfigurablePlatformTheme) {
                // allow to use the getters from ConfigurablePlatformTheme
                // to insert logo and such
                $data['themeObj'] = $theme;
            }
            //render the template
            $renderer = new \Renderer($tpl, $data);
            return $renderer->render();
        }
        return '';
    }
697538
public function getTemplateId($shortId)
    {
        $result = $this->httpRaw(self::WECHAT_TEMPLATE_ID_GET_PREFIX, [
            'template_id_short' => $shortId
        ], [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['template_id']) ? $result['template_id'] : false;
    }
815339
public function getCampaignParamsFor($templateId, array $params = null)
    {
        $campaignParams = array(
            $this->tracking_params_campaign_medium => 'email',
            $this->tracking_params_campaign_name => date('y-m-d'),
        );

        if (self::NEWSLETTER_TEMPLATE == $templateId) {
            $campaignParams[$this->tracking_params_campaign_source] = 'newsletter';
        } elseif (self::NOTIFICATIONS_TEMPLATE == $templateId) {
            $campaignParams[$this->tracking_params_campaign_source] = 'mailnotify';
        } elseif (self::CONTENT_ITEM_MESSAGE_TEMPLATE == $templateId) {
            $campaignParams[$this->tracking_params_campaign_content] = 'message';

        // don't track password-reset emails
        } elseif (self::FOS_USER_PWD_RESETTING_TEMPLATE == $templateId || self::FOS_USER_REGISTRATION_TEMPLATE == $templateId) {
            $campaignParams = array();
        }

        return $campaignParams;
    }
1177026
def EmailTemplate(
        self,
        TemplateId,
        TemplateModel,
        From,
        To,
        TemplateAlias=None,
        Cc=None,
        Bcc=None,
        Subject=None,
        Tag=None,
        ReplyTo=None,
        Headers=None,
        TrackOpens=None,
        TrackLinks="None",
        Attachments=None,
        InlineCss=True,
    ):
        
        return EmailTemplate(
            manager=self,
            TemplateId=TemplateId,
            TemplateAlias=TemplateAlias,
            TemplateModel=TemplateModel,
            From=From,
            To=To,
            Cc=Cc,
            Bcc=Bcc,
            Subject=Subject,
            Tag=Tag,
            ReplyTo=ReplyTo,
            Headers=Headers,
            TrackOpens=TrackOpens,
            TrackLinks=TrackLinks,
            Attachments=Attachments,
            InlineCss=InlineCss,
        )
1329991
public function template($name, $tempId = null)
    {
        Util::operateArray($this->smsData['templates'], $name, $tempId);

        return $this;
    }
1281681
public function apply(&$templateString) {

		$this->encoding = strtoupper(Application::getInstance()->getConfig()->site->default_encoding);

		$templateString = preg_replace_callback(
			'~(^|\s|>|(?:<a [^>]*?>.*?))'.Rex::URI_STRICT.'(<|\s|$)~i',
			array($this, 'urlAnchors'),
			$templateString
		);

		$templateString = preg_replace_callback(
			'~(<a [^>]*?>.*?|)('.Rex::EMAIL.')([^<]*</a>|)~i',
			array($this, 'obfuscatedMailAnchors'),
			$templateString
		);

	}
580939
public function serialize(TemplateType $templateType)
    {
        $serialized = [
            'id' => $templateType->getUuid(),
            'name' => $templateType->getName(),
            'placeholders' => $templateType->getPlaceholders(),
            'defaultTemplate' => $templateType->getDefaultTemplate(),
        ];

        return $serialized;
    }
1168379
public function actionEdit($templateId, $languageId = null)
    {
        $editForm = new EditForm([
            'templateId' => $templateId,
            'languageId' => $languageId
        ]);
        return $this->renderForm($editForm, 'edit');
    }