19 declare(strict_types=1);
40 $this->mustache_factory->getBasicEngine()->render($subject, []);
46 $this->mustache_factory->getBasicEngine()->render($message, []);
52 $template->setContext($context_id);
53 $template->setTitle($title);
54 $template->setSubject($subject);
55 $template->setMessage($message);
56 $template->setLang($language);
72 $this->mustache_factory->getBasicEngine()->render($subject, []);
78 $this->mustache_factory->getBasicEngine()->render($message, []);
83 $template = $this->
repository->findById($template_id);
85 $template->setContext($context_id);
86 $template->setTitle($title);
87 $template->setSubject($subject);
88 $template->setMessage($message);
89 $template->setLang($language);
96 return $this->
repository->findById($template_id);
101 return $this->
repository->findByContextId($context_id);
106 $this->
repository->deleteByIds($template_ids);
126 foreach ($all_of_context as $other_template) {
127 $other_template->setAsDefault(
false);
129 if ($template->
getTplId() === $other_template->getTplId()) {
130 $other_template->setAsDefault(
true);
repository()
description: > Example for rendering a repository card
__construct(protected ilMailTemplateRepository $repository, protected ilMustacheFactory $mustache_factory)
deleteTemplatesByIds(array $template_ids)
loadTemplatesForContextId(string $context_id)
loadTemplateForId(int $template_id)
unsetAsContextDefault(ilMailTemplate $template)
modifyExistingTemplate(int $template_id, string $context_id, string $title, string $subject, string $message, string $language)
setAsDefault(bool $is_default)
listAllTemplatesAsArray()
setAsContextDefault(ilMailTemplate $template)
createNewTemplate(string $context_id, string $title, string $subject, string $message, string $language)