ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ILIAS\Mail\Recipient Class Reference
+ Collaboration diagram for ILIAS\Mail\Recipient:

Public Member Functions

 __construct (private readonly int $user_id, private readonly ?ilObjUser $user, private readonly ilMailOptions $mail_options, private readonly Conductor $legal_documents)
 
 getUserId ()
 
 getMailOptions ()
 
 isUser ()
 
 isUserActive ()
 
 evaluateInternalMailReadability ()
 
 userWantsToReceiveExternalMails ()
 
 onlyToExternalMailAddress ()
 
 getExternalMailAddress ()
 

Detailed Description

Definition at line 30 of file Recipient.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Mail\Recipient::__construct ( private readonly int  $user_id,
private readonly ?ilObjUser  $user,
private readonly ilMailOptions  $mail_options,
private readonly Conductor  $legal_documents 
)

Definition at line 32 of file Recipient.php.

37  {
38  }

Member Function Documentation

◆ evaluateInternalMailReadability()

ILIAS\Mail\Recipient::evaluateInternalMailReadability ( )

Definition at line 60 of file Recipient.php.

References ILIAS\Repository\user().

60  : Result
61  {
62  if (!$this->user->checkTimeLimit()) {
63  return new Error('Account expired.');
64  }
65 
66  return $this->legal_documents->userCanReadInternalMail()->applyTo(new Ok($this->user));
67  }
+ Here is the call graph for this function:

◆ getExternalMailAddress()

ILIAS\Mail\Recipient::getExternalMailAddress ( )
Returns
string[]

Definition at line 83 of file Recipient.php.

83  : array
84  {
85  return $this->mail_options->getExternalEmailAddresses();
86  }

◆ getMailOptions()

ILIAS\Mail\Recipient::getMailOptions ( )

Definition at line 45 of file Recipient.php.

46  {
47  return $this->mail_options;
48  }

◆ getUserId()

ILIAS\Mail\Recipient::getUserId ( )

Definition at line 40 of file Recipient.php.

References $user_id.

40  : int
41  {
42  return $this->user_id;
43  }

◆ isUser()

ILIAS\Mail\Recipient::isUser ( )

Definition at line 50 of file Recipient.php.

References ILIAS\Repository\user().

50  : bool
51  {
52  return !is_null($this->user);
53  }
+ Here is the call graph for this function:

◆ isUserActive()

ILIAS\Mail\Recipient::isUserActive ( )

Definition at line 55 of file Recipient.php.

References ILIAS\Repository\user().

55  : bool
56  {
57  return $this->user->getActive();
58  }
+ Here is the call graph for this function:

◆ onlyToExternalMailAddress()

ILIAS\Mail\Recipient::onlyToExternalMailAddress ( )

Definition at line 75 of file Recipient.php.

References ilMailOptions\INCOMING_EMAIL.

75  : bool
76  {
77  return $this->mail_options->getIncomingType() === ilMailOptions::INCOMING_EMAIL;
78  }
final const INCOMING_EMAIL

◆ userWantsToReceiveExternalMails()

ILIAS\Mail\Recipient::userWantsToReceiveExternalMails ( )

Definition at line 69 of file Recipient.php.

References ilMailOptions\INCOMING_BOTH, and ilMailOptions\INCOMING_EMAIL.

69  : bool
70  {
71  return $this->mail_options->getIncomingType() === ilMailOptions::INCOMING_EMAIL ||
72  $this->mail_options->getIncomingType() === ilMailOptions::INCOMING_BOTH;
73  }
final const INCOMING_EMAIL
final const INCOMING_BOTH

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