ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLearningSequenceMembershipMailNotification Class Reference
+ Inheritance diagram for ilLearningSequenceMembershipMailNotification:
+ Collaboration diagram for ilLearningSequenceMembershipMailNotification:

Public Member Functions

 __construct (ilLogger $logger, ilSetting $settings)
 
 forceSendingMail (bool $status)
 
 send ()
 
- 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 ()
 

Data Fields

const TYPE_ADMISSION_MEMBER = 20
 
const TYPE_DISMISS_MEMBER = 21
 
const TYPE_ACCEPTED_SUBSCRIPTION_MEMBER = 22
 
const TYPE_REFUSED_SUBSCRIPTION_MEMBER = 23
 
const TYPE_STATUS_CHANGED = 24
 
const TYPE_BLOCKED_MEMBER = 25
 
const TYPE_UNBLOCKED_MEMBER = 26
 
const TYPE_UNSUBSCRIBE_MEMBER = 27
 
const TYPE_SUBSCRIBE_MEMBER = 28
 
const TYPE_WAITING_LIST_MEMBER = 29
 
const TYPE_NOTIFICATION_REGISTRATION = 30
 
const TYPE_NOTIFICATION_REGISTRATION_REQUEST = 31
 
const TYPE_NOTIFICATION_UNSUBSCRIBE = 32
 
- Data Fields inherited from ilMailNotification
final const int SUBJECT_TITLE_LENGTH = 60
 

Protected Member Functions

 initLanguage (int $usr_id)
 
 createLearningSequenceStatus (int $usr_id)
 
 isNotificationTypeEnabled (int $type)
 
- 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

array $permanent_enabled_notifications
 Notifications which are not affected by "mail_grp_member_notification" setting because they addresses admins. More...
 
ilLogger $logger
 
ilSetting $settings
 
- 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
 

Private Attributes

bool $force_sending_mail = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ createLearningSequenceStatus()

ilLearningSequenceMembershipMailNotification::createLearningSequenceStatus ( int  $usr_id)
protected

Definition at line 388 of file class.ilLearningSequenceMembershipMailNotification.php.

388 : string
389 {
391 $body = $this->getLanguageText('lso_new_status') . "\n";
392 $body .= $this->getLanguageText('role') . ': ';
393
394 if ($part->isAdmin($usr_id)) {
395 $body .= $this->getLanguageText('il_lso_admin') . "\n";
396 } else {
397 $body .= $this->getLanguageText('il_lso_member') . "\n";
398 }
399
400 if ($part->isAdmin($usr_id)) {
401 $body .= $this->getLanguageText('lso_notification') . ': ';
402
403 if ($part->isNotificationEnabled($usr_id)) {
404 $body .= $this->getLanguageText('lso_notify_on') . "\n";
405 } else {
406 $body .= $this->getLanguageText('lso_notify_off') . "\n";
407 }
408 }
409
410 return $body;
411 }
getLanguageText(string $a_keyword)

References ilMailNotification\$body, ilLearningSequenceParticipants\_getInstanceByObjId(), ilMailNotification\getLanguageText(), and ilMailNotification\getObjId().

Referenced by send().

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

◆ forceSendingMail()

ilLearningSequenceMembershipMailNotification::forceSendingMail ( bool  $status)

Definition at line 62 of file class.ilLearningSequenceMembershipMailNotification.php.

62 : void
63 {
64 $this->force_sending_mail = $status;
65 }

◆ initLanguage()

ilLearningSequenceMembershipMailNotification::initLanguage ( int  $usr_id)
protected

Reimplemented from ilMailNotification.

Definition at line 382 of file class.ilLearningSequenceMembershipMailNotification.php.

382 : void
383 {
384 parent::initLanguage($usr_id);
385 $this->getLanguage()->loadLanguageModule('lso');
386 }

References ilMailNotification\getLanguage().

Referenced by send().

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

◆ isNotificationTypeEnabled()

ilLearningSequenceMembershipMailNotification::isNotificationTypeEnabled ( int  $type)
protected

Definition at line 413 of file class.ilLearningSequenceMembershipMailNotification.php.

413 : bool
414 {
415 return (
416 $this->force_sending_mail ||
417 $this->settings->get('mail_lso_member_notification', "true") ||
418 in_array($type, $this->permanent_enabled_notifications)
419 );
420 }

References ilMailNotification\$type, and ILIAS\Repository\settings().

Referenced by send().

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

◆ send()

ilLearningSequenceMembershipMailNotification::send ( )

Definition at line 67 of file class.ilLearningSequenceMembershipMailNotification.php.

67 : bool
68 {
69 if (!$this->isNotificationTypeEnabled($this->getType())) {
70 $this->logger->info('Membership mail disabled globally.');
71 return false;
72 }
73
74 switch ($this->getType()) {
76 foreach ($this->getRecipients() as $rcp) {
77 $this->initLanguage($rcp);
78 $this->initMail();
79 $this->setSubject(sprintf(
80 $this->getLanguageText('lso_mail_admission_new_sub'),
81 $this->getObjectTitle(true)
82 ));
84 $rcp,
85 $this->getLanguage()
86 ));
87 $this->appendBody("\n\n");
88 $this->appendBody(sprintf(
89 $this->getLanguageText('lso_mail_admission_new_bod'),
90 $this->getObjectTitle()
91 ));
92 $this->appendBody("\n\n");
93 $this->appendBody(
94 $this->getLanguageText('lso_mail_permanent_link')
95 );
96 $this->appendBody("\n\n");
97 $this->appendBody($this->createPermanentLink());
98 $this->getMail()->appendInstallationSignature(true);
99 $this->sendMail(array($rcp));
100 }
101 break;
103 foreach ($this->getRecipients() as $rcp) {
104 $this->initLanguage($rcp);
105 $this->initMail();
106 $this->setSubject(sprintf(
107 $this->getLanguageText('lso_mail_dismiss_sub'),
108 $this->getObjectTitle(true)
109 ));
111 $rcp,
112 $this->getLanguage()
113 ));
114 $this->appendBody("\n\n");
115 $this->appendBody(sprintf(
116 $this->getLanguageText('lso_mail_dismiss_bod'),
117 $this->getObjectTitle()
118 ));
119 $this->getMail()->appendInstallationSignature(true);
120 $this->sendMail(array($rcp));
121 }
122 break;
124 foreach ($this->getRecipients() as $rcp) {
125 $this->initLanguage($rcp);
126 $this->initMail();
127 $this->setSubject(sprintf(
128 $this->getLanguageText('lso_mail_notification_reg_sub'),
129 $this->getObjectTitle(true)
130 ));
132 $rcp,
133 $this->getLanguage()
134 ));
135 $this->appendBody("\n\n");
137 $this->appendBody(sprintf(
138 $this->getLanguageText('lso_mail_notification_reg_bod'),
139 $this->userToString($info['usr_id']),
140 $this->getObjectTitle()
141 ));
142 $this->appendBody("\n\n");
143 $this->appendBody(
144 $this->getLanguageText('lso_mail_permanent_link')
145 );
146 $this->appendBody("\n\n");
147 $this->appendBody(
148 $this->createPermanentLink(array(), '_mem')
149 );
150 $this->appendBody("\n\n");
151 $this->appendBody($this->getLanguageText(
152 'lso_notification_explanation_admin'
153 ));
154 $this->getMail()->appendInstallationSignature(true);
155 $this->sendMail(array($rcp));
156 }
157 break;
159 foreach ($this->getRecipients() as $rcp) {
160 $this->initLanguage($rcp);
161 $this->initMail();
162 $this->setSubject(sprintf(
163 $this->getLanguageText('lso_mail_unsubscribe_member_sub'),
164 $this->getObjectTitle(true)
165 ));
167 $rcp,
168 $this->getLanguage()
169 ));
170 $this->appendBody("\n\n");
171 $this->appendBody(sprintf(
172 $this->getLanguageText('lso_mail_unsubscribe_member_bod'),
173 $this->getObjectTitle()
174 ));
175 $this->getMail()->appendInstallationSignature(true);
176 $this->sendMail(array($rcp));
177 }
178 break;
180 foreach ($this->getRecipients() as $rcp) {
181 $this->initLanguage($rcp);
182 $this->initMail();
183 $this->setSubject(sprintf(
184 $this->getLanguageText('lso_mail_notification_unsub_sub'),
185 $this->getObjectTitle(true)
186 ));
188 $rcp,
189 $this->getLanguage()
190 ));
191 $this->appendBody("\n\n");
193 $this->appendBody(sprintf(
194 $this->getLanguageText('lso_mail_notification_unsub_bod'),
195 $this->userToString($info['usr_id']),
196 $this->getObjectTitle()
197 ));
198 $this->appendBody("\n\n");
199 $this->appendBody(
200 $this->getLanguageText(
201 'lso_mail_notification_unsub_bod2'
202 )
203 );
204 $this->appendBody("\n\n");
205 $this->appendBody($this->createPermanentLink(
206 array(),
207 '_mem'
208 ));
209 $this->appendBody("\n\n");
210 $this->appendBody(
211 $this->getLanguageText(
212 'lso_notification_explanation_admin'
213 )
214 );
215 $this->getMail()->appendInstallationSignature(true);
216 $this->sendMail(array($rcp));
217 }
218 break;
220 foreach ($this->getRecipients() as $rcp) {
221 $this->initLanguage($rcp);
222 $this->initMail();
223 $this->setSubject(sprintf(
224 $this->getLanguageText('grp_mail_subscribe_member_sub'),
225 $this->getObjectTitle(true)
226 ));
228 $rcp,
229 $this->getLanguage()
230 ));
231 $this->appendBody("\n\n");
232 $this->appendBody(
233 sprintf(
234 $this->getLanguageText('grp_mail_subscribe_member_bod'),
235 $this->getObjectTitle()
236 )
237 );
238 $this->appendBody("\n\n");
239 $this->appendBody(
240 $this->getLanguageText('grp_mail_permanent_link')
241 );
242 $this->appendBody("\n\n");
243 $this->appendBody($this->createPermanentLink());
244 $this->getMail()->appendInstallationSignature(true);
245 $this->sendMail(array($rcp));
246 }
247 break;
249 foreach ($this->getRecipients() as $rcp) {
250 $this->initLanguage($rcp);
251 $this->initMail();
252 $this->setSubject(sprintf(
253 $this->getLanguageText('grp_mail_notification_reg_req_sub'),
254 $this->getObjectTitle(true)
255 ));
257 $rcp,
258 $this->getLanguage()
259 ));
260 $this->appendBody("\n\n");
262 $this->appendBody(sprintf(
263 $this->getLanguageText('grp_mail_notification_reg_req_bod'),
264 $this->userToString($info['usr_id']),
265 $this->getObjectTitle()
266 ));
267 $this->appendBody("\n\n");
268 $this->appendBody(
269 $this->getLanguageText('grp_mail_notification_reg_req_bod2')
270 );
271 $this->appendBody("\n");
272 $this->appendBody($this->createPermanentLink(array(), '_mem'));
273 $this->appendBody("\n\n");
274 $this->appendBody(
275 $this->getLanguageText('grp_notification_explanation_admin')
276 );
277 $this->getMail()->appendInstallationSignature(true);
278 $this->sendMail(array($rcp));
279 }
280 break;
282 foreach ($this->getRecipients() as $rcp) {
283 $this->initLanguage($rcp);
284 $this->initMail();
285 $this->setSubject(sprintf(
286 $this->getLanguageText('grp_mail_sub_dec_sub'),
287 $this->getObjectTitle(true)
288 ));
290 $rcp,
291 $this->getLanguage()
292 ));
293 $this->appendBody("\n\n");
294 $this->appendBody(sprintf(
295 $this->getLanguageText('grp_mail_sub_dec_bod'),
296 $this->getObjectTitle()
297 ));
298 $this->getMail()->appendInstallationSignature(true);
299 $this->sendMail(array($rcp));
300 }
301 break;
303 foreach ($this->getRecipients() as $rcp) {
304 $this->initLanguage($rcp);
305 $this->initMail();
306 $this->setSubject(sprintf(
307 $this->getLanguageText('grp_mail_sub_acc_sub'),
308 $this->getObjectTitle(true)
309 ));
310 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
311 $this->appendBody("\n\n");
312 $this->appendBody(sprintf(
313 $this->getLanguageText('grp_mail_sub_acc_bod'),
314 $this->getObjectTitle()
315 ));
316 $this->appendBody("\n\n");
317 $this->appendBody(
318 $this->getLanguageText('grp_mail_permanent_link')
319 );
320 $this->appendBody("\n\n");
321 $this->appendBody($this->createPermanentLink());
322 $this->getMail()->appendInstallationSignature(true);
323 $this->sendMail(array($rcp));
324 }
325 break;
327 foreach ($this->getRecipients() as $rcp) {
328 $this->initLanguage($rcp);
329 $this->initMail();
330 $this->setSubject(sprintf(
331 $this->getLanguageText('grp_mail_wl_sub'),
332 $this->getObjectTitle(true)
333 ));
335 $rcp,
336 $this->getLanguage()
337 ));
339 $this->appendBody("\n\n");
340 $this->appendBody(sprintf(
341 $this->getLanguageText('grp_mail_wl_bod'),
342 $this->getObjectTitle(),
343 $info['position']
344 ));
345 $this->getMail()->appendInstallationSignature(true);
346 $this->sendMail(array($rcp));
347 }
348 break;
350 foreach ($this->getRecipients() as $rcp) {
351 $this->initLanguage($rcp);
352 $this->initMail();
353 $this->setSubject(sprintf(
354 $this->getLanguageText('grp_mail_status_sub'),
355 $this->getObjectTitle(true)
356 ));
358 $rcp,
359 $this->getLanguage()
360 ));
361 $this->appendBody("\n\n");
362 $this->appendBody(sprintf(
363 $this->getLanguageText('grp_mail_status_bod'),
364 $this->getObjectTitle()
365 ));
366 $this->appendBody("\n\n");
367 $this->appendBody($this->createLearningSequenceStatus((int) $rcp));
368 $this->appendBody("\n\n");
369 $this->appendBody(
370 $this->getLanguageText('grp_mail_permanent_link')
371 );
372 $this->appendBody("\n\n");
373 $this->appendBody($this->createPermanentLink());
374 $this->getMail()->appendInstallationSignature(true);
375 $this->sendMail(array($rcp));
376 }
377 break;
378 }
379 return true;
380 }
getObjectTitle(bool $a_shorten=false)
sendMail(array $a_rcp, bool $a_parse_recipients=true)
createPermanentLink(array $a_params=[], string $a_append='')
setSubject(string $a_subject)
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
$info
Definition: entry_point.php:21

References $info, ilMailNotification\appendBody(), createLearningSequenceStatus(), ilMailNotification\createPermanentLink(), ilMailNotification\getAdditionalInformation(), ilMailNotification\getLanguage(), ilMailNotification\getLanguageText(), ilMailNotification\getMail(), ilMailNotification\getObjectTitle(), ilMailNotification\getRecipients(), ilMail\getSalutation(), ilMailNotification\getType(), initLanguage(), ilMailNotification\initMail(), isNotificationTypeEnabled(), ILIAS\Repository\logger(), ilMailNotification\sendMail(), ilMailNotification\setBody(), ilMailNotification\setSubject(), TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, TYPE_ADMISSION_MEMBER, TYPE_DISMISS_MEMBER, TYPE_NOTIFICATION_REGISTRATION, TYPE_NOTIFICATION_REGISTRATION_REQUEST, TYPE_NOTIFICATION_UNSUBSCRIBE, TYPE_REFUSED_SUBSCRIPTION_MEMBER, TYPE_STATUS_CHANGED, TYPE_SUBSCRIBE_MEMBER, TYPE_UNSUBSCRIBE_MEMBER, TYPE_WAITING_LIST_MEMBER, and ilMailNotification\userToString().

+ Here is the call graph for this function:

Field Documentation

◆ $force_sending_mail

bool ilLearningSequenceMembershipMailNotification::$force_sending_mail = false
private

◆ $logger

ilLogger ilLearningSequenceMembershipMailNotification::$logger
protected

Definition at line 50 of file class.ilLearningSequenceMembershipMailNotification.php.

Referenced by __construct().

◆ $permanent_enabled_notifications

array ilLearningSequenceMembershipMailNotification::$permanent_enabled_notifications
protected
Initial value:

Notifications which are not affected by "mail_grp_member_notification" setting because they addresses admins.

Definition at line 44 of file class.ilLearningSequenceMembershipMailNotification.php.

◆ $settings

ilSetting ilLearningSequenceMembershipMailNotification::$settings
protected

Definition at line 51 of file class.ilLearningSequenceMembershipMailNotification.php.

Referenced by __construct().

◆ TYPE_ACCEPTED_SUBSCRIPTION_MEMBER

const ilLearningSequenceMembershipMailNotification::TYPE_ACCEPTED_SUBSCRIPTION_MEMBER = 22

◆ TYPE_ADMISSION_MEMBER

const ilLearningSequenceMembershipMailNotification::TYPE_ADMISSION_MEMBER = 20

◆ TYPE_BLOCKED_MEMBER

const ilLearningSequenceMembershipMailNotification::TYPE_BLOCKED_MEMBER = 25

◆ TYPE_DISMISS_MEMBER

const ilLearningSequenceMembershipMailNotification::TYPE_DISMISS_MEMBER = 21

◆ TYPE_NOTIFICATION_REGISTRATION

const ilLearningSequenceMembershipMailNotification::TYPE_NOTIFICATION_REGISTRATION = 30

◆ TYPE_NOTIFICATION_REGISTRATION_REQUEST

const ilLearningSequenceMembershipMailNotification::TYPE_NOTIFICATION_REGISTRATION_REQUEST = 31

◆ TYPE_NOTIFICATION_UNSUBSCRIBE

const ilLearningSequenceMembershipMailNotification::TYPE_NOTIFICATION_UNSUBSCRIBE = 32

◆ TYPE_REFUSED_SUBSCRIPTION_MEMBER

const ilLearningSequenceMembershipMailNotification::TYPE_REFUSED_SUBSCRIPTION_MEMBER = 23

◆ TYPE_STATUS_CHANGED

const ilLearningSequenceMembershipMailNotification::TYPE_STATUS_CHANGED = 24

◆ TYPE_SUBSCRIBE_MEMBER

const ilLearningSequenceMembershipMailNotification::TYPE_SUBSCRIBE_MEMBER = 28

◆ TYPE_UNBLOCKED_MEMBER

const ilLearningSequenceMembershipMailNotification::TYPE_UNBLOCKED_MEMBER = 26

◆ TYPE_UNSUBSCRIBE_MEMBER

const ilLearningSequenceMembershipMailNotification::TYPE_UNSUBSCRIBE_MEMBER = 27

◆ TYPE_WAITING_LIST_MEMBER

const ilLearningSequenceMembershipMailNotification::TYPE_WAITING_LIST_MEMBER = 29

Definition at line 33 of file class.ilLearningSequenceMembershipMailNotification.php.

Referenced by send().


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