19 declare(strict_types=1);
40 $this->mustacheFactory->getBasicEngine()->render($subject, []);
46 $this->mustacheFactory->getBasicEngine()->render($message, []);
52 $template->setContext($contextId);
53 $template->setTitle($title);
54 $template->setSubject($subject);
55 $template->setMessage($message);
56 $template->setLang($language);
72 $this->mustacheFactory->getBasicEngine()->render($subject, []);
78 $this->mustacheFactory->getBasicEngine()->render($message, []);
83 $template = $this->
repository->findById($templateId);
85 $template->setContext($contextId);
86 $template->setTitle($title);
87 $template->setSubject($subject);
88 $template->setMessage($message);
89 $template->setLang($language);
96 return $this->
repository->findById($templateId);
101 return $this->
repository->findByContextId($contextId);
128 foreach ($allOfContext as $otherTemplate) {
129 $otherTemplate->setAsDefault(
false);
131 if ($template->
getTplId() === $otherTemplate->getTplId()) {
132 $otherTemplate->setAsDefault(
true);
modifyExistingTemplate(int $templateId, string $contextId, string $title, string $subject, string $message, string $language)
loadTemplatesForContextId(string $contextId)
__construct(protected ilMailTemplateRepository $repository, protected ilMustacheFactory $mustacheFactory)
repository()
description: > Example for rendering a repository card
setAsDefault(bool $isDefault)
createNewTemplate(string $contextId, string $title, string $subject, string $message, string $language)
loadTemplateForId(int $templateId)
unsetAsContextDefault(ilMailTemplate $template)
listAllTemplatesAsArray()
deleteTemplatesByIds(array $templateIds)
setAsContextDefault(ilMailTemplate $template)