ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ILIAS\Registration\DualOptIn\Mail\DualOptInMail Class Reference
+ Inheritance diagram for ILIAS\Registration\DualOptIn\Mail\DualOptInMail:
+ Collaboration diagram for ILIAS\Registration\DualOptIn\Mail\DualOptInMail:

Public Member Functions

 __construct (private readonly \ilObjUser $user, private readonly PendingRegistration $pending_reg, private readonly int $hash_lifetime_sec)
 
 send ()
 
- 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 ()
 

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 25 of file DualOptInMail.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Registration\DualOptIn\Mail\DualOptInMail::__construct ( private readonly \ilObjUser  $user,
private readonly PendingRegistration  $pending_reg,
private readonly int  $hash_lifetime_sec 
)

Definition at line 27 of file DualOptInMail.php.

31 {
33 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ send()

ILIAS\Registration\DualOptIn\Mail\DualOptInMail::send ( )

Definition at line 35 of file DualOptInMail.php.

35 : void
36 {
37 $this->getLanguage()->loadLanguageModule('registration');
38
39 foreach ($this->getRecipients() as $rcp) {
40 try {
41 $this->handleCurrentRecipient($rcp);
42 } catch (\ilMailException) {
43 continue;
44 }
45
46 $this->initMimeMail();
47 $this->setSubject($this->getLanguage()->txt('reg_mail_subject_confirmation'));
48 $this->setBody(
49 $this->getLanguage()->txt('reg_mail_body_salutation')
50 . ' '
51 . $this->user->getFullname()
52 . ','
53 );
54 $this->appendBody("\n\n");
55 $this->appendBody($this->getLanguage()->txt('reg_mail_body_activation'));
56 $this->appendBody("\n");
57 $this->appendBody(
59 . '/confirmReg.php?client_id='
60 . CLIENT_ID
61 . '&rh='
62 . $this->pending_reg->hash()->toString()
63 );
64 $this->appendBody("\n\n");
65 $this->appendBody(
66 \sprintf(
67 $this->getLanguage()->txt('reg_mail_body_2_confirmation'),
69 $this->hash_lifetime_sec,
70 false,
71 $this->getLanguage()
72 )
73 )
74 );
75 $this->appendBody("\n\n");
76 $this->appendBody($this->getLanguage()->txt('reg_mail_body_3_confirmation'));
78
79 $this->sendMimeMail($this->getCurrentRecipient());
80 }
81 }
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static _getInstallationSignature()
static _getHttpPath()
const CLIENT_ID
Definition: constants.php:41

References ilUtil\_getHttpPath(), ilMail\_getInstallationSignature(), ilMailNotification\appendBody(), CLIENT_ID, ilMimeMailNotification\getCurrentRecipient(), ilMailNotification\getLanguage(), ilMailNotification\getRecipients(), ilMimeMailNotification\initMimeMail(), ilDatePresentation\secondsToString(), ilMimeMailNotification\sendMimeMail(), ilMailNotification\setBody(), ilMimeMailNotification\setSubject(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

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