38 $template = new \ilMailTemplate();
39 $template->setContext($contextId);
40 $template->setTitle($title);
41 $template->setSubject($subject);
42 $template->setMessage($message);
43 $template->setLang($language);
66 $template = $this->
repository->findById($templateId);
68 $template->setContext($contextId);
69 $template->setTitle($title);
70 $template->setSubject($subject);
71 $template->setMessage($message);
72 $template->setLang($language);
83 return $this->
repository->findById($templateId);
92 return $this->
repository->findByContextId($contextId);
133 foreach ($allOfContext as $otherTemplate) {
134 $otherTemplate->setAsDefault(
false);
136 if ((
int) $template->
getTplId() === (int) $otherTemplate->getTplId()) {
137 $otherTemplate->setAsDefault(
true);
unsetAsContextDefault(\ilMailTemplate $template)
modifyExistingTemplate(int $templateId, string $contextId, string $title, string $subject, string $message, string $language)
loadTemplatesForContextId(string $contextId)
Class ilMailTemplateService.
setAsDefault(bool $isDefault)
__construct(\ilMailTemplateRepository $repository)
ilMailTemplateService constructor.
createNewTemplate(string $contextId, string $title, string $subject, string $message, string $language)
loadTemplateForId(int $templateId)
setAsContextDefault(\ilMailTemplate $template)
Class ilMailTemplateRepository.
listAllTemplatesAsArray()
deleteTemplatesByIds(array $templateIds)