ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSessionMembershipMailNotification.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once './Services/Mail/classes/class.ilMailNotification.php';
5
13{
16
19
20
23
26
30
31
35 public function __construct()
36 {
37 parent::__construct();
38 }
39
44 public function send()
45 {
46 global $ilSetting;
47
48 // parent::send();
49
50 switch ($this->getType()) {
52
53 // automatic mails about status change disabled
54 if (!$ilSetting->get('mail_grp_member_notification', false)) {
55 return;
56 }
57
58 foreach ($this->getRecipients() as $rcp) {
59 $this->initLanguage($rcp);
60 $this->initMail();
61 $this->setSubject(
62 sprintf($this->getLanguageText('grp_mail_admission_new_sub'), $this->getObjectTitle(true))
63 );
64 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
65 $this->appendBody("\n\n");
66 $this->appendBody(
67 sprintf($this->getLanguageText('grp_mail_admission_new_bod'), $this->getObjectTitle())
68 );
69 $this->appendBody("\n\n");
70 $this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
71 $this->appendBody("\n\n");
72 $this->appendBody($this->createPermanentLink());
73 $this->getMail()->appendInstallationSignature(true);
74
75 $this->sendMail(array($rcp), array('system'));
76 }
77 break;
78
80
81 // automatic mails about status change disabled
82 if (!$ilSetting->get('mail_grp_member_notification', false)) {
83 return;
84 }
85
86 foreach ($this->getRecipients() as $rcp) {
87 $this->initLanguage($rcp);
88 $this->initMail();
89 $this->setSubject(
90 sprintf($this->getLanguageText('grp_mail_dismiss_sub'), $this->getObjectTitle(true))
91 );
92 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
93 $this->appendBody("\n\n");
94 $this->appendBody(
95 sprintf($this->getLanguageText('grp_mail_dismiss_bod'), $this->getObjectTitle())
96 );
97 $this->getMail()->appendInstallationSignature(true);
98 $this->sendMail(array($rcp), array('system'));
99 }
100 break;
101
102
103
104
106
107 foreach ($this->getRecipients() as $rcp) {
108 $this->initLanguage($rcp);
109 $this->initMail();
110 $this->setSubject(
111 sprintf($this->getLanguageText('grp_mail_subscribe_member_sub'), $this->getObjectTitle(true))
112 );
113 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
114 $this->appendBody("\n\n");
115 $this->appendBody(
116 sprintf($this->getLanguageText('grp_mail_subscribe_member_bod'), $this->getObjectTitle())
117 );
118
119 $this->appendBody("\n\n");
120 $this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
121 $this->appendBody("\n\n");
122 $this->appendBody($this->createPermanentLink());
123 $this->getMail()->appendInstallationSignature(true);
124
125 $this->sendMail(array($rcp), array('system'));
126 }
127 break;
128
129
131
132 foreach ($this->getRecipients() as $rcp) {
133 $this->initLanguage($rcp);
134 $this->initMail();
135 $this->setSubject(
136 sprintf($this->getLanguageText('grp_mail_notification_reg_req_sub'), $this->getObjectTitle(true))
137 );
138 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
139 $this->appendBody("\n\n");
140
142 $this->appendBody(
143 sprintf(
144 $this->getLanguageText('grp_mail_notification_reg_req_bod'),
145 $this->userToString($info['usr_id']),
146 $this->getObjectTitle()
147 )
148 );
149 $this->appendBody("\n\n");
150 $this->appendBody($this->getLanguageText('grp_mail_notification_reg_req_bod2'));
151 $this->appendBody("\n");
152 $this->appendBody($this->createPermanentLink(array(), '_mem'));
153
154 $this->appendBody("\n\n");
155 $this->appendBody($this->getLanguageText('grp_notification_explanation_admin'));
156
157 $this->getMail()->appendInstallationSignature(true);
158 $this->sendMail(array($rcp), array('system'));
159 }
160 break;
161
163
164 foreach ($this->getRecipients() as $rcp) {
165 $this->initLanguage($rcp);
166 $this->initMail();
167 $this->setSubject(
168 sprintf($this->getLanguageText('sess_mail_sub_dec_sub'), $this->getObjectTitle(true))
169 );
170 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
171 $this->appendBody("\n\n");
172 $this->appendBody(
173 sprintf($this->getLanguageText('sess_mail_sub_dec_bod'), $this->getObjectTitle())
174 );
175
176 $this->getMail()->appendInstallationSignature(true);
177
178 $this->sendMail(array($rcp), array('system'));
179 }
180 break;
181
183
184 foreach ($this->getRecipients() as $rcp) {
185 $this->initLanguage($rcp);
186 $this->initMail();
187 $this->setSubject(
188 sprintf($this->getLanguageText('sess_mail_sub_acc_sub'), $this->getObjectTitle(true))
189 );
190 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
191 $this->appendBody("\n\n");
192 $this->appendBody(
193 sprintf($this->getLanguageText('sess_mail_sub_acc_bod'), $this->getObjectTitle())
194 );
195 $this->appendBody("\n\n");
196 $this->appendBody($this->getLanguageText('sess_mail_permanent_link'));
197 $this->appendBody("\n\n");
198 $this->appendBody($this->createPermanentLink());
199 $this->getMail()->appendInstallationSignature(true);
200
201 $this->sendMail(array($rcp), array('system'));
202 }
203 break;
204
205 }
206 return true;
207 }
208
214 protected function initLanguage($a_usr_id)
215 {
216 parent::initLanguage($a_usr_id);
217 $this->getLanguage()->loadLanguageModule('sess');
218 }
219}
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
Base class for course/group mail notifications.
appendBody($a_body)
Append body text.
sendMail(array $a_rcp, $a_type, $a_parse_recipients=true)
getType()
Get notification type.
getRecipients()
get array of recipients
getObjectTitle($a_shorten=false)
createPermanentLink($a_params=array(), $a_append='')
static getSalutation($a_usr_id, ilLanguage $a_language=null)
$info
Definition: index.php:5
global $ilSetting
Definition: privfeed.php:17