ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilMailMimeTransportFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  public function __construct(protected ilSetting $settings, private readonly ilAppEventHandler $event_handler)
24  {
25  }
26 
27  public function getTransport(): ilMailMimeTransport
28  {
29  if (!$this->settings->get('mail_allow_external', '0')) {
30  return new ilMailMimeTransportNull();
31  }
32 
33  if ($this->settings->get('mail_smtp_status', '0')) {
34  return new ilMailMimeTransportSmtp($this->settings, $this->event_handler);
35  }
36 
37  return new ilMailMimeTransportSendmail($this->settings, $this->event_handler);
38  }
39 }
Global event handler.
__construct(protected ilSetting $settings, private readonly ilAppEventHandler $event_handler)