ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilRegistrationMailNotification.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
27 public const TYPE_NOTIFICATION_APPROVERS = 30;
29
34 public function send(): void
35 {
36 switch ($this->getType()) {
38
39 foreach ($this->getRecipients() as $rcp) {
40 $this->initLanguage($rcp);
41 $this->initMail();
42 $this->setSubject(
43 $this->getLanguageText('reg_mail_new_user')
44 );
45
46 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
47 $this->appendBody("\n\n");
48
49 $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
50 $this->appendBody("\n\n");
51 $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
52
54
55 $this->appendBody("\n\n");
56 $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
57
58 $this->appendBody("\n\n");
59 $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
60
61 $this->getMail()->appendInstallationSignature(true);
62 $this->sendMail([$rcp]);
63 }
64 break;
65
67
68 foreach ($this->getRecipients() as $rcp) {
69 $this->initLanguage($rcp);
70 $this->initMail();
71 $this->setSubject(
72 $this->getLanguageText('reg_mail_new_user_confirmation')
73 );
74
75 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
76 $this->appendBody("\n\n");
77
78 $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
79 $this->appendBody("\n\n");
80 $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
81
83
84 $this->appendBody("\n\n");
85 $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
86
87 $this->appendBody("\n\n");
88 $this->appendBody($this->getLanguageText('reg_mail_body_confirmation'));
89 $this->appendBody("\n"); // #4527
90 $this->appendBody(ilLink::_getStaticLink($info['usr']->getId(), "usrf"));
91
92 $this->appendBody("\n\n");
93 $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
94
95 $this->getMail()->appendInstallationSignature(true);
96 $this->sendMail([$rcp]);
97 }
98 break;
99 }
100 }
101
102 protected function initLanguage(int $a_usr_id): void
103 {
104 parent::initLanguage($a_usr_id);
105 $this->getLanguage()->loadLanguageModule('registration');
106 }
107}
sendMail(array $a_rcp, bool $a_parse_recipients=true)
getLanguageText(string $a_keyword)
setSubject(string $a_subject)
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
$info
Definition: entry_point.php:21