ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
MailService.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27use ILIAS\Data\Factory as DataFactory;
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
82 {
83 return new \ilMustacheFactory();
84 }
85
87 {
88 return new MailSignatureService(
89 $this->mustacheFactory(),
90 $this->dic->clientIni(),
91 $this->dic->language(),
92 $this->dic->settings()
93 );
94 }
95}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Builds data types.
Definition: Factory.php:36
__construct(protected Container $dic)
Definition: MailService.php:34
$c
Definition: deliver.php:25
$dic
Definition: ltiresult.php:33