ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
DualOptInMail.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
26{
27 public function __construct(
28 private readonly \ilObjUser $user,
29 private readonly PendingRegistration $pending_reg,
30 private readonly int $hash_lifetime_sec
31 ) {
33 }
34
35 public function send(): 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 }
82}
__construct(private readonly \ilObjUser $user, private readonly PendingRegistration $pending_reg, private readonly int $hash_lifetime_sec)
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()
User class.
static _getHttpPath()
const CLIENT_ID
Definition: constants.php:41
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc