ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
MailService.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
31 
33 {
34  public function __construct(protected Container $dic)
35  {
36  if (!isset($this->dic[ilMailTemplateServiceInterface::class])) {
37  $this->dic[ilMailTemplateServiceInterface::class] = static function (Container $c): ilMailTemplateServiceInterface {
38  return new ilMailTemplateService(
39  new ilMailTemplateRepository($c->database()),
40  $c->mail()->mustacheFactory()
41  );
42  };
43  }
44  }
45 
46  public function mime(): MimeMailService
47  {
48  return new MimeMailService($this->dic);
49  }
50 
52  {
53  return new AutoresponderServiceImpl(
54  (int) $this->dic->settings()->get(
55  'mail_auto_responder_idle_time',
56  (string) AutoresponderService::AUTO_RESPONDER_DEFAULT_IDLE_TIME
57  ),
58  false,
59  new AutoresponderDatabaseRepository($this->dic->database()),
60  (new DataFactory())->clock()->utc()
61  );
62  }
63 
65  {
66  return $this->dic[ilMailTemplateServiceInterface::class];
67  }
68 
70  {
71  return new \ilMailTemplatePlaceholderResolver(
72  $this->mustacheFactory()->getBasicEngine()
73  );
74  }
75 
77  {
78  return new \ilMailTemplatePlaceholderToEmptyResolver();
79  }
80 
81  public function mustacheFactory(): \ilMustacheFactory
82  {
83  return new \ilMustacheFactory();
84  }
85 
86  public function signature(): MailSignatureService
87  {
88  return new MailSignatureService(
89  $this->mustacheFactory(),
90  $this->dic->clientIni(),
91  $this->dic->language(),
92  $this->dic->settings()
93  );
94  }
95 }
$c
Definition: deliver.php:25
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilMailTemplatePlaceholderResolver.
__construct(protected Container $dic)
Definition: MailService.php:34
$dic
Definition: result.php:31