ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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',
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 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
Class ilMailTemplatePlaceholderResolver.
__construct(protected Container $dic)
Definition: MailService.php:34
$dic
Definition: result.php:32