ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilMailTransportSettings Class Reference
+ Collaboration diagram for ilMailTransportSettings:

Public Member Functions

 __construct (private readonly ilMailOptions $mail_options)
 
 adjust (string $first_mail, string $second_mail, bool $persist=true)
 

Detailed Description

Definition at line 21 of file class.ilMailTransportSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailTransportSettings::__construct ( private readonly ilMailOptions  $mail_options)

Definition at line 23 of file class.ilMailTransportSettings.php.

24  {
25  }

Member Function Documentation

◆ adjust()

ilMailTransportSettings::adjust ( string  $first_mail,
string  $second_mail,
bool  $persist = true 
)

Definition at line 27 of file class.ilMailTransportSettings.php.

References ilMailOptions\FIRST_EMAIL, ilMailOptions\INCOMING_LOCAL, and ilMailOptions\SECOND_EMAIL.

27  : void
28  {
29  if ($this->mail_options->getIncomingType() === ilMailOptions::INCOMING_LOCAL) {
30  return;
31  }
32 
33  $has_first_email = $first_mail !== '';
34  $has_second_email = $second_mail !== '';
35 
36  if (!$has_first_email && !$has_second_email) {
37  $this->mail_options->setIncomingType(ilMailOptions::INCOMING_LOCAL);
38  if ($persist) {
39  $this->mail_options->updateOptions();
40  }
41  return;
42  }
43 
44  if (!$has_first_email && $this->mail_options->getEmailAddressMode() !== ilMailOptions::SECOND_EMAIL) {
45  $this->mail_options->setEmailAddressmode(ilMailOptions::SECOND_EMAIL);
46  if ($persist) {
47  $this->mail_options->updateOptions();
48  }
49  return;
50  }
51 
52  if (!$has_second_email && $this->mail_options->getEmailAddressMode() !== ilMailOptions::FIRST_EMAIL) {
53  $this->mail_options->setEmailAddressmode(ilMailOptions::FIRST_EMAIL);
54  if ($persist) {
55  $this->mail_options->updateOptions();
56  }
57  }
58  }
final const int SECOND_EMAIL
final const int INCOMING_LOCAL
final const int FIRST_EMAIL

The documentation for this class was generated from the following file: