19declare(strict_types=1);
41 $this->template_engine_factory->getBasicEngine()->render($subject, []);
47 $this->template_engine_factory->getBasicEngine()->render($message, []);
53 $template->setContext($context_id);
54 $template->setTitle($title);
55 $template->setSubject($subject);
56 $template->setMessage($message);
57 $template->setLang($language);
73 $this->template_engine_factory->getBasicEngine()->render($subject, []);
79 $this->template_engine_factory->getBasicEngine()->render($message, []);
84 $template = $this->
repository->findById($template_id);
86 $template->setContext($context_id);
87 $template->setTitle($title);
88 $template->setSubject($subject);
89 $template->setMessage($message);
90 $template->setLang($language);
97 return $this->
repository->findById($template_id);
102 return $this->
repository->findByContextId($context_id);
107 $this->
repository->deleteByIds($template_ids);
127 foreach ($all_of_context as $other_template) {
128 $other_template->setAsDefault(
false);
130 if ($template->
getTplId() === $other_template->getTplId()) {
131 $other_template->setAsDefault(
true);
listAllTemplatesAsArray()
loadTemplatesForContextId(string $context_id)
createNewTemplate(string $context_id, string $title, string $subject, string $message, string $language)
deleteTemplatesByIds(array $template_ids)
loadTemplateForId(int $template_id)
modifyExistingTemplate(int $template_id, string $context_id, string $title, string $subject, string $message, string $language)
setAsContextDefault(ilMailTemplate $template)
unsetAsContextDefault(ilMailTemplate $template)
__construct(protected ilMailTemplateRepository $repository, protected TemplateEngineFactoryInterface $template_engine_factory)
setAsDefault(bool $is_default)
Factory interface for creating template engine instances.