19 declare(strict_types=1);
43 $template->setContext($contextId);
44 $template->setTitle($title);
45 $template->setSubject($subject);
46 $template->setMessage($message);
47 $template->setLang($language);
62 $template = $this->
repository->findById($templateId);
64 $template->setContext($contextId);
65 $template->setTitle($title);
66 $template->setSubject($subject);
67 $template->setMessage($message);
68 $template->setLang($language);
75 return $this->
repository->findById($templateId);
84 return $this->
repository->findByContextId($contextId);
102 return array_map(
static function (
ilMailTemplate $template): array {
117 foreach ($allOfContext as $otherTemplate) {
118 $otherTemplate->setAsDefault(
false);
120 if ($template->
getTplId() === $otherTemplate->getTplId()) {
121 $otherTemplate->setAsDefault(
true);
modifyExistingTemplate(int $templateId, string $contextId, string $title, string $subject, string $message, string $language)
loadTemplatesForContextId(string $contextId)
__construct(ilMailTemplateRepository $repository)
Class ilMailTemplateService.
setAsDefault(bool $isDefault)
createNewTemplate(string $contextId, string $title, string $subject, string $message, string $language)
loadTemplateForId(int $templateId)
unsetAsContextDefault(ilMailTemplate $template)
ilMailTemplateRepository $repository
Class ilMailTemplateRepository.
listAllTemplatesAsArray()
deleteTemplatesByIds(array $templateIds)
setAsContextDefault(ilMailTemplate $template)