ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilGroupMembershipMailNotification Class Reference
+ Inheritance diagram for ilGroupMembershipMailNotification:
+ Collaboration diagram for ilGroupMembershipMailNotification:

Public Member Functions

 __construct ()
 
 send ()
 Send notifications. More...
 
- Public Member Functions inherited from ilMailNotification
 __construct ($a_is_personal_workspace=false)
 
 setType ($a_type)
 Set notification type. More...
 
 getType ()
 Get notification type. More...
 
 setSender ($a_usr_id)
 Set sender of mail. More...
 
 getSender ()
 get sender of mail More...
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 get array of recipients More...
 
 setAttachments ($a_att)
 Set attachments
More...
 
 getAttachments ()
 Get attachments
More...
 
 setLangModules (array $a_modules)
 Set lang modules. More...
 
 getUserLanguage ($a_usr_id)
 Get user language. More...
 
 setRefId ($a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId ($a_obj_id)
 
 getObjType ()
 Get object type. More...
 
 setAdditionalInformation (array $a_info)
 Additional information for creating notification mails. More...
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, $a_type, $a_parse_recipients=true)
 
 getBlockBorder ()
 Get (ascii) block border. More...
 

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
const SUBJECT_TITLE_LENGTH = 60
 

Protected Member Functions

 initLanguage ($a_usr_id)
 Add language module crs. More...
 
 createGroupStatus ($a_usr_id)
 Get course status body. More...
 
 isNotificationTypeEnabled ($a_type)
 get setting "mail_grp_member_notification" and excludes types which are not affected by this setting See description of $this->permanent_enabled_notifications More...
 
- Protected Member Functions inherited from ilMailNotification
 setSubject ($a_subject)
 
 getSubject ()
 
 setBody ($a_body)
 
 appendBody ($a_body)
 Append body text. More...
 
 getBody ()
 
 initLanguage ($a_usr_id)
 Init language. More...
 
 initLanguageByIso2Code ($a_code='')
 Init language by ISO2 code. More...
 
 setLanguage ($a_language)
 
 getLanguage ()
 
 getLanguageText ($a_keyword)
 
 getObjectTitle ($a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink ($a_params=array(), $a_append='')
 
 userToString ($a_usr_id)
 
 isRefIdAccessible ($a_user_id, $a_ref_id, $a_permission="read")
 Check if ref id is accessible for user. More...
 

Protected Attributes

 $permanent_enabled_notifications
 Notifications which are not affected by "mail_grp_member_notification" setting because they addresses admins. More...
 
- Protected Attributes inherited from ilMailNotification
 $type = null
 
 $sender = null
 
 $mail = null
 
 $subject = ''
 
 $body = ''
 
 $attachments = array()
 
 $language = null
 
 $lang_modules = array()
 
 $recipients = array()
 
 $ref_id = null
 
 $obj_id = null
 
 $obj_type = null
 
 $additional_info = array()
 
 $is_in_wsp
 
 $wsp_tree
 
 $wsp_access_handler
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilGroupMembershipMailNotification::__construct ( )

Definition at line 49 of file class.ilGroupMembershipMailNotification.php.

50 {
51 parent::__construct();
52 }

Member Function Documentation

◆ createGroupStatus()

ilGroupMembershipMailNotification::createGroupStatus (   $a_usr_id)
protected

Get course status body.

Parameters
int$a_usr_id
Returns
string

Definition at line 373 of file class.ilGroupMembershipMailNotification.php.

374 {
376
377 $body = $this->getLanguageText('grp_new_status')."\n";
378 $body .= $this->getLanguageText('role').': ';
379
380
381 if($part->isAdmin($a_usr_id))
382 {
383 $body .= $this->getLanguageText('il_grp_admin')."\n";
384
385 }
386 else
387 {
388 $body .= $this->getLanguageText('il_grp_member')."\n";
389 }
390
391 if($part->isAdmin($a_usr_id))
392 {
393 $body .= $this->getLanguageText('grp_notification').': ';
394
395 if($part->isNotificationEnabled($a_usr_id))
396 {
397 $body .= $this->getLanguageText('grp_notify_on')."\n";
398 }
399 else
400 {
401 $body .= $this->getLanguageText('grp_notify_off')."\n";
402 }
403 }
404 return $body;
405 }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.

References ilMailNotification\$body, ilGroupParticipants\_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:

◆ initLanguage()

ilGroupMembershipMailNotification::initLanguage (   $a_usr_id)
protected

Add language module crs.

Parameters
object$a_usr_id
Returns

Reimplemented from ilMailNotification.

Definition at line 362 of file class.ilGroupMembershipMailNotification.php.

363 {
364 parent::initLanguage($a_usr_id);
365 $this->getLanguage()->loadLanguageModule('grp');
366 }

References ilMailNotification\getLanguage().

Referenced by send().

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

◆ isNotificationTypeEnabled()

ilGroupMembershipMailNotification::isNotificationTypeEnabled (   $a_type)
protected

get setting "mail_grp_member_notification" and excludes types which are not affected by this setting See description of $this->permanent_enabled_notifications

Parameters
int$a_type
Returns
bool

Definition at line 414 of file class.ilGroupMembershipMailNotification.php.

415 {
416 global $ilSetting;
417
418 return $ilSetting->get('mail_grp_member_notification',true) || in_array($a_type, $this->permanent_enabled_notifications);
419 }
global $ilSetting
Definition: privfeed.php:40

References $ilSetting.

Referenced by send().

+ Here is the caller graph for this function:

◆ send()

ilGroupMembershipMailNotification::send ( )

Send notifications.

Returns

Definition at line 58 of file class.ilGroupMembershipMailNotification.php.

59 {
60 if(!$this->isNotificationTypeEnabled($this->getType()))
61 {
62 $GLOBALS['ilLog']->write(__METHOD__.': Membership mail disabled globally.');
63 return false;
64 }
65 // parent::send();
66
67 switch($this->getType())
68 {
70
71 foreach($this->getRecipients() as $rcp)
72 {
73 $this->initLanguage($rcp);
74 $this->initMail();
75 $this->setSubject(
76 sprintf($this->getLanguageText('grp_mail_admission_new_sub'),$this->getObjectTitle(true))
77 );
78 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
79 $this->appendBody("\n\n");
80 $this->appendBody(
81 sprintf($this->getLanguageText('grp_mail_admission_new_bod'),$this->getObjectTitle())
82 );
83 $this->appendBody("\n\n");
84 $this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
85 $this->appendBody("\n\n");
86 $this->appendBody($this->createPermanentLink());
87 $this->getMail()->appendInstallationSignature(true);
88
89 $this->sendMail(array($rcp),array('system'));
90 }
91 break;
92
94
95 foreach($this->getRecipients() as $rcp)
96 {
97 $this->initLanguage($rcp);
98 $this->initMail();
99 $this->setSubject(
100 sprintf($this->getLanguageText('grp_mail_dismiss_sub'),$this->getObjectTitle(true))
101 );
102 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
103 $this->appendBody("\n\n");
104 $this->appendBody(
105 sprintf($this->getLanguageText('grp_mail_dismiss_bod'),$this->getObjectTitle())
106 );
107 $this->getMail()->appendInstallationSignature(true);
108 $this->sendMail(array($rcp),array('system'));
109 }
110 break;
111
112
114
115 foreach($this->getRecipients() as $rcp)
116 {
117 $this->initLanguage($rcp);
118 $this->initMail();
119 $this->setSubject(
120 sprintf($this->getLanguageText('grp_mail_notification_reg_sub'),$this->getObjectTitle(true))
121 );
122 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
123 $this->appendBody("\n\n");
124
126 $this->appendBody(
127 sprintf($this->getLanguageText('grp_mail_notification_reg_bod'),
128 $this->userToString($info['usr_id']),
129 $this->getObjectTitle()
130 )
131 );
132 $this->appendBody("\n\n");
133 $this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
134 $this->appendBody("\n\n");
135 $this->appendBody($this->createPermanentLink(array(),'_mem'));
136
137 $this->appendBody("\n\n");
138 $this->appendBody($this->getLanguageText('grp_notification_explanation_admin'));
139
140 $this->getMail()->appendInstallationSignature(true);
141 $this->sendMail(array($rcp),array('system'));
142 }
143 break;
144
146
147 foreach($this->getRecipients() as $rcp)
148 {
149 $this->initLanguage($rcp);
150 $this->initMail();
151 $this->setSubject(
152 sprintf($this->getLanguageText('grp_mail_unsubscribe_member_sub'),$this->getObjectTitle(true))
153 );
154 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
155 $this->appendBody("\n\n");
156 $this->appendBody(
157 sprintf($this->getLanguageText('grp_mail_unsubscribe_member_bod'),$this->getObjectTitle())
158 );
159 $this->getMail()->appendInstallationSignature(true);
160 $this->sendMail(array($rcp),array('system'));
161 }
162 break;
163
165
166 foreach($this->getRecipients() as $rcp)
167 {
168 $this->initLanguage($rcp);
169 $this->initMail();
170 $this->setSubject(
171 sprintf($this->getLanguageText('grp_mail_notification_unsub_sub'),$this->getObjectTitle(true))
172 );
173 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
174 $this->appendBody("\n\n");
175
177 $this->appendBody(
178 sprintf($this->getLanguageText('grp_mail_notification_unsub_bod'),
179 $this->userToString($info['usr_id']),
180 $this->getObjectTitle()
181 )
182 );
183 $this->appendBody("\n\n");
184 $this->appendBody($this->getLanguageText('grp_mail_notification_unsub_bod2'));
185 $this->appendBody("\n\n");
186 $this->appendBody($this->createPermanentLink(array(),'_mem'));
187
188 $this->appendBody("\n\n");
189 $this->appendBody($this->getLanguageText('grp_notification_explanation_admin'));
190
191 $this->getMail()->appendInstallationSignature(true);
192 $this->sendMail(array($rcp),array('system'));
193 }
194 break;
195
196
198
199 foreach($this->getRecipients() as $rcp)
200 {
201 $this->initLanguage($rcp);
202 $this->initMail();
203 $this->setSubject(
204 sprintf($this->getLanguageText('grp_mail_subscribe_member_sub'),$this->getObjectTitle(true))
205 );
206 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
207 $this->appendBody("\n\n");
208 $this->appendBody(
209 sprintf($this->getLanguageText('grp_mail_subscribe_member_bod'),$this->getObjectTitle())
210 );
211
212 $this->appendBody("\n\n");
213 $this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
214 $this->appendBody("\n\n");
215 $this->appendBody($this->createPermanentLink());
216 $this->getMail()->appendInstallationSignature(true);
217
218 $this->sendMail(array($rcp),array('system'));
219 }
220 break;
221
222
224
225 foreach($this->getRecipients() as $rcp)
226 {
227 $this->initLanguage($rcp);
228 $this->initMail();
229 $this->setSubject(
230 sprintf($this->getLanguageText('grp_mail_notification_reg_req_sub'),$this->getObjectTitle(true))
231 );
232 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
233 $this->appendBody("\n\n");
234
236 $this->appendBody(
237 sprintf($this->getLanguageText('grp_mail_notification_reg_req_bod'),
238 $this->userToString($info['usr_id']),
239 $this->getObjectTitle()
240 )
241 );
242 $this->appendBody("\n\n");
243 $this->appendBody($this->getLanguageText('grp_mail_notification_reg_req_bod2'));
244 $this->appendBody("\n");
245 $this->appendBody($this->createPermanentLink(array(),'_mem'));
246
247 $this->appendBody("\n\n");
248 $this->appendBody($this->getLanguageText('grp_notification_explanation_admin'));
249
250 $this->getMail()->appendInstallationSignature(true);
251 $this->sendMail(array($rcp),array('system'));
252 }
253 break;
254
256
257 foreach($this->getRecipients() as $rcp)
258 {
259 $this->initLanguage($rcp);
260 $this->initMail();
261 $this->setSubject(
262 sprintf($this->getLanguageText('grp_mail_sub_dec_sub'),$this->getObjectTitle(true))
263 );
264 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
265 $this->appendBody("\n\n");
266 $this->appendBody(
267 sprintf($this->getLanguageText('grp_mail_sub_dec_bod'),$this->getObjectTitle())
268 );
269
270 $this->getMail()->appendInstallationSignature(true);
271
272 $this->sendMail(array($rcp),array('system'));
273 }
274 break;
275
277
278 foreach($this->getRecipients() as $rcp)
279 {
280 $this->initLanguage($rcp);
281 $this->initMail();
282 $this->setSubject(
283 sprintf($this->getLanguageText('grp_mail_sub_acc_sub'),$this->getObjectTitle(true))
284 );
285 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
286 $this->appendBody("\n\n");
287 $this->appendBody(
288 sprintf($this->getLanguageText('grp_mail_sub_acc_bod'),$this->getObjectTitle())
289 );
290 $this->appendBody("\n\n");
291 $this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
292 $this->appendBody("\n\n");
293 $this->appendBody($this->createPermanentLink());
294 $this->getMail()->appendInstallationSignature(true);
295
296 $this->sendMail(array($rcp),array('system'));
297 }
298 break;
299
301 foreach($this->getRecipients() as $rcp)
302 {
303 $this->initLanguage($rcp);
304 $this->initMail();
305 $this->setSubject(
306 sprintf($this->getLanguageText('grp_mail_wl_sub'),$this->getObjectTitle(true))
307 );
308
309 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
310
312 $this->appendBody("\n\n");
313 $this->appendBody(
314 sprintf($this->getLanguageText('grp_mail_wl_bod'),
315 $this->getObjectTitle(),
316 $info['position']
317 )
318 );
319 $this->getMail()->appendInstallationSignature(true);
320 $this->sendMail(array($rcp),array('system'));
321 }
322 break;
323
324
326 foreach($this->getRecipients() as $rcp)
327 {
328 $this->initLanguage($rcp);
329 $this->initMail();
330 $this->setSubject(
331 sprintf($this->getLanguageText('grp_mail_status_sub'),$this->getObjectTitle(true))
332 );
333 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
334 $this->appendBody("\n\n");
335 $this->appendBody(
336 sprintf($this->getLanguageText('grp_mail_status_bod'),$this->getObjectTitle())
337 );
338
339 $this->appendBody("\n\n");
340 $this->appendBody($this->createGroupStatus($rcp));
341
342 $this->appendBody("\n\n");
343 $this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
344 $this->appendBody("\n\n");
345 $this->appendBody($this->createPermanentLink());
346
347 $this->getMail()->appendInstallationSignature(true);
348
349 $this->sendMail(array($rcp),array('system'));
350 }
351 break;
352
353 }
354 return true;
355 }
isNotificationTypeEnabled($a_type)
get setting "mail_grp_member_notification" and excludes types which are not affected by this setting ...
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, $a_language=null)
Get salutation.
$info
Definition: example_052.php:80
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $GLOBALS, $info, ilMailNotification\appendBody(), createGroupStatus(), ilMailNotification\createPermanentLink(), ilMailNotification\getAdditionalInformation(), ilMailNotification\getLanguage(), ilMailNotification\getLanguageText(), ilMailNotification\getMail(), ilMailNotification\getObjectTitle(), ilMailNotification\getRecipients(), ilMail\getSalutation(), ilMailNotification\getType(), initLanguage(), ilMailNotification\initMail(), isNotificationTypeEnabled(), 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

◆ $permanent_enabled_notifications

array ilGroupMembershipMailNotification::$permanent_enabled_notifications
protected
Initial value:
= array(
self::TYPE_NOTIFICATION_REGISTRATION,
self::TYPE_NOTIFICATION_REGISTRATION_REQUEST,
self::TYPE_NOTIFICATION_UNSUBSCRIBE
)

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

Definition at line 40 of file class.ilGroupMembershipMailNotification.php.

◆ TYPE_ACCEPTED_SUBSCRIPTION_MEMBER

const ilGroupMembershipMailNotification::TYPE_ACCEPTED_SUBSCRIPTION_MEMBER = 22

◆ TYPE_ADMISSION_MEMBER

const ilGroupMembershipMailNotification::TYPE_ADMISSION_MEMBER = 20

◆ TYPE_BLOCKED_MEMBER

const ilGroupMembershipMailNotification::TYPE_BLOCKED_MEMBER = 25

Definition at line 23 of file class.ilGroupMembershipMailNotification.php.

◆ TYPE_DISMISS_MEMBER

const ilGroupMembershipMailNotification::TYPE_DISMISS_MEMBER = 21

◆ TYPE_NOTIFICATION_REGISTRATION

const ilGroupMembershipMailNotification::TYPE_NOTIFICATION_REGISTRATION = 30

◆ TYPE_NOTIFICATION_REGISTRATION_REQUEST

const ilGroupMembershipMailNotification::TYPE_NOTIFICATION_REGISTRATION_REQUEST = 31

◆ TYPE_NOTIFICATION_UNSUBSCRIBE

const ilGroupMembershipMailNotification::TYPE_NOTIFICATION_UNSUBSCRIBE = 32

◆ TYPE_REFUSED_SUBSCRIPTION_MEMBER

const ilGroupMembershipMailNotification::TYPE_REFUSED_SUBSCRIPTION_MEMBER = 23

◆ TYPE_STATUS_CHANGED

const ilGroupMembershipMailNotification::TYPE_STATUS_CHANGED = 24

◆ TYPE_SUBSCRIBE_MEMBER

const ilGroupMembershipMailNotification::TYPE_SUBSCRIBE_MEMBER = 28

◆ TYPE_UNBLOCKED_MEMBER

const ilGroupMembershipMailNotification::TYPE_UNBLOCKED_MEMBER = 26

Definition at line 24 of file class.ilGroupMembershipMailNotification.php.

◆ TYPE_UNSUBSCRIBE_MEMBER

const ilGroupMembershipMailNotification::TYPE_UNSUBSCRIBE_MEMBER = 27

◆ TYPE_WAITING_LIST_MEMBER

const ilGroupMembershipMailNotification::TYPE_WAITING_LIST_MEMBER = 29

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