ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\User\Profile\ChangeMail\Mail Class Reference
+ Inheritance diagram for ILIAS\User\Profile\ChangeMail\Mail:
+ Collaboration diagram for ILIAS\User\Profile\ChangeMail\Mail:

Public Member Functions

 __construct (private readonly \ilObjUser $user, private readonly URI $uri, private readonly Language $lng, private \ilLogger $logger)
 
 send (string $new_email, int $validity)
 
- Public Member Functions inherited from ilMimeMailNotification
 __construct (bool $a_is_personal_workspace=false)
 
 sendMimeMail (string $a_rcp)
 
 setCurrentRecipient (string $current_recipient)
 
 getCurrentRecipient ()
 
 setMimeMail (ilMimeMail $mime_mail)
 
 getMimeMail ()
 
- Public Member Functions inherited from ilMailNotification
 __construct (protected bool $is_in_wsp=false)
 
 setType (int $a_type)
 
 getType ()
 
 setSender (int $a_usr_id)
 
 getSender ()
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 
 setAttachments (array $a_att)
 
 getAttachments ()
 
 setLangModules (array $a_modules)
 
 getUserLanguage (int $a_usr_id)
 
 setRefId (int $a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId (int $a_obj_id)
 
 getObjType ()
 
 setAdditionalInformation (array $a_info)
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, bool $a_parse_recipients=true)
 
 getBlockBorder ()
 

Private Member Functions

 sendEmailToNewEmailAddress (string $new_email, int $validity)
 
 sendEmailToExistingAddress (string $new_email, int $validity)
 

Additional Inherited Members

- Data Fields inherited from ilMailNotification
final const int SUBJECT_TITLE_LENGTH = 60
 
- Protected Member Functions inherited from ilMimeMailNotification
 setSubject (string $a_subject)
 
 initMimeMail ()
 
 initLanguageByIso2Code (string $a_code='')
 
 initLanguage (int $a_usr_id)
 
- Protected Member Functions inherited from ilMailNotification
 setSubject (string $a_subject)
 
 getSubject ()
 
 setBody (string $a_body)
 
 appendBody (string $a_body)
 
 getBody ()
 
 initLanguage (int $a_usr_id)
 
 initLanguageByIso2Code (string $a_code='')
 
 setLanguage (ilLanguage $a_language)
 
 getLanguage ()
 
 getLanguageText (string $a_keyword)
 
 getObjectTitle (bool $a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink (array $a_params=[], string $a_append='')
 
 userToString (int $a_usr_id)
 
 isRefIdAccessible (int $a_user_id, int $a_ref_id, string $a_permission='read')
 
- Protected Attributes inherited from ilMimeMailNotification
ilMimeMail $mime_mail
 
string $current_recipient
 
ilMailMimeSenderFactory $sender_factory
 
- Protected Attributes inherited from ilMailNotification
int $type
 
int $sender
 
ilMail $mail = null
 
string $subject = ''
 
string $body = ''
 
array $attachments = []
 
ilLanguage $language
 
array $lang_modules = []
 
array $recipients = []
 
int $ref_id
 
int $obj_id = 0
 
string $obj_type = ''
 
array $additional_info = []
 
ilWorkspaceTree $wsp_tree
 
ilWorkspaceAccessHandler $wsp_access_handler
 

Detailed Description

Definition at line 26 of file Mail.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\Profile\ChangeMail\Mail::__construct ( private readonly \ilObjUser  $user,
private readonly URI  $uri,
private readonly Language  $lng,
private \ilLogger  $logger 
)

Definition at line 28 of file Mail.php.

33 {
34 $lng->loadLanguageModule('mail');
36 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $lng
Definition: privfeed.php:31

References $lng, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ send()

ILIAS\User\Profile\ChangeMail\Mail::send ( string  $new_email,
int  $validity 
)

Definition at line 38 of file Mail.php.

38 : void
39 {
40 $this->sendEmailToNewEmailAddress($new_email, $validity);
41 $this->sendEmailToExistingAddress($new_email, $validity);
42 }
sendEmailToNewEmailAddress(string $new_email, int $validity)
Definition: Mail.php:44
sendEmailToExistingAddress(string $new_email, int $validity)
Definition: Mail.php:72

References ILIAS\User\Profile\ChangeMail\Mail\sendEmailToExistingAddress(), and ILIAS\User\Profile\ChangeMail\Mail\sendEmailToNewEmailAddress().

+ Here is the call graph for this function:

◆ sendEmailToExistingAddress()

ILIAS\User\Profile\ChangeMail\Mail::sendEmailToExistingAddress ( string  $new_email,
int  $validity 
)
private

Definition at line 72 of file Mail.php.

72 : void
73 {
74 if (!$this->user->getEmail()) {
75 $this->logger->debug(
76 sprintf(
77 'Missing email address, did not send email to inform about email change to user %s (id: %s)',
78 $this->user->getLogin(),
79 $this->user->getId()
80 )
81 );
82 return;
83 }
84
85 $this->initMimeMail();
86 $this->initLanguageByIso2Code($this->user->getLanguage());
87 $this->setSubject($this->lng->txt('change_email_email_information_subject'));
88 $this->setBody($this->lng->txt('mail_salutation_n') . ' ' . $this->user->getFullname() . ',');
89 $this->appendBody("\n\n");
90 $this->appendBody(
91 sprintf(
92 $this->lng->txt('change_email_email_information_body'),
93 $this->user->getLogin(),
94 $new_email,
95 floor($validity / 60)
96 )
97 );
99
100 $this->sendMimeMail($this->user->getEmail());
101 $this->logger->debug(
102 sprintf(
103 'Email to inform about email change sent to user %s (id: %s|language: %s).',
104 $this->user->getLogin(),
105 $this->user->getId(),
106 $this->user->getLanguage()
107 )
108 );
109
110 }
static _getInstallationSignature()

References ilMail\_getInstallationSignature(), ilMailNotification\appendBody(), ilMimeMailNotification\initLanguageByIso2Code(), ilMimeMailNotification\initMimeMail(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ilMimeMailNotification\sendMimeMail(), ilMailNotification\setBody(), ilMimeMailNotification\setSubject(), and ILIAS\Repository\user().

Referenced by ILIAS\User\Profile\ChangeMail\Mail\send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendEmailToNewEmailAddress()

ILIAS\User\Profile\ChangeMail\Mail::sendEmailToNewEmailAddress ( string  $new_email,
int  $validity 
)
private

Definition at line 44 of file Mail.php.

44 : void
45 {
46 $this->initMimeMail();
47 $this->initLanguageByIso2Code($this->user->getLanguage());
48 $this->setSubject($this->lng->txt('change_email_email_confirmation_subject'));
49 $this->setBody($this->lng->txt('mail_salutation_n') . ' ' . $this->user->getFullname() . ',');
50 $this->appendBody("\n\n");
51 $this->appendBody(
52 sprintf(
53 $this->lng->txt('change_email_email_confirmation_body'),
54 $this->user->getLogin(),
55 $this->uri->__toString(),
56 floor($validity / 60)
57 )
58 );
60
61 $this->sendMimeMail($new_email);
62 $this->logger->debug(
63 sprintf(
64 'Email to confirm email change sent to user %s (id: %s|language: %s).',
65 $this->user->getLogin(),
66 $this->user->getId(),
67 $this->user->getLanguage()
68 )
69 );
70 }

References ilMail\_getInstallationSignature(), ilMailNotification\appendBody(), ilMimeMailNotification\initLanguageByIso2Code(), ilMimeMailNotification\initMimeMail(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ilMimeMailNotification\sendMimeMail(), ilMailNotification\setBody(), ilMimeMailNotification\setSubject(), and ILIAS\Repository\user().

Referenced by ILIAS\User\Profile\ChangeMail\Mail\send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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