ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSessionMembershipMailNotification Class Reference
+ Inheritance diagram for ilSessionMembershipMailNotification:
+ Collaboration diagram for ilSessionMembershipMailNotification:

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_BLOCKED_MEMBER = 25
 
const TYPE_UNBLOCKED_MEMBER = 26
 
const TYPE_UNSUBSCRIBE_MEMBER = 27
 
const TYPE_SUBSCRIBE_MEMBER = 28
 
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...
 
- 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...
 

Additional Inherited Members

- 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()

ilSessionMembershipMailNotification::__construct ( )

Definition at line 35 of file class.ilSessionMembershipMailNotification.php.

36  {
37  parent::__construct();
38  }

Member Function Documentation

◆ initLanguage()

ilSessionMembershipMailNotification::initLanguage (   $a_usr_id)
protected

Add language module crs.

Parameters
object$a_usr_id
Returns

Definition at line 214 of file class.ilSessionMembershipMailNotification.php.

References ilMailNotification\getLanguage().

Referenced by send().

215  {
216  parent::initLanguage($a_usr_id);
217  $this->getLanguage()->loadLanguageModule('sess');
218  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send()

ilSessionMembershipMailNotification::send ( )

Send notifications.

Returns

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

References $ilSetting, $info, ilMailNotification\appendBody(), array, ilMailNotification\createPermanentLink(), ilMailNotification\getAdditionalInformation(), ilMailNotification\getLanguage(), ilMailNotification\getLanguageText(), ilMailNotification\getMail(), ilMailNotification\getObjectTitle(), ilMailNotification\getRecipients(), ilMail\getSalutation(), ilMailNotification\getType(), initLanguage(), ilMailNotification\initMail(), ilMailNotification\sendMail(), ilMailNotification\setBody(), ilMailNotification\setSubject(), and ilMailNotification\userToString().

45  {
46  global $ilSetting;
47 
48  // parent::send();
49 
50  switch ($this->getType()) {
51  case self::TYPE_ADMISSION_MEMBER:
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 
79  case self::TYPE_DISMISS_MEMBER:
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 
105  case self::TYPE_SUBSCRIBE_MEMBER:
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 
130  case self::TYPE_NOTIFICATION_REGISTRATION_REQUEST:
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 
141  $info = $this->getAdditionalInformation();
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 
162  case self::TYPE_REFUSED_SUBSCRIPTION_MEMBER:
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 
182  case self::TYPE_ACCEPTED_SUBSCRIPTION_MEMBER:
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  }
getType()
Get notification type.
getObjectTitle($a_shorten=false)
Create styles array
The data for the language used.
sendMail(array $a_rcp, $a_type, $a_parse_recipients=true)
getRecipients()
get array of recipients
createPermanentLink($a_params=array(), $a_append='')
global $ilSetting
Definition: privfeed.php:17
appendBody($a_body)
Append body text.
$info
Definition: index.php:5
static getSalutation($a_usr_id, ilLanguage $a_language=null)
+ Here is the call graph for this function:

Field Documentation

◆ TYPE_ACCEPTED_SUBSCRIPTION_MEMBER

const ilSessionMembershipMailNotification::TYPE_ACCEPTED_SUBSCRIPTION_MEMBER = 22

◆ TYPE_ADMISSION_MEMBER

const ilSessionMembershipMailNotification::TYPE_ADMISSION_MEMBER = 20

◆ TYPE_BLOCKED_MEMBER

const ilSessionMembershipMailNotification::TYPE_BLOCKED_MEMBER = 25

◆ TYPE_DISMISS_MEMBER

const ilSessionMembershipMailNotification::TYPE_DISMISS_MEMBER = 21

◆ TYPE_NOTIFICATION_REGISTRATION

const ilSessionMembershipMailNotification::TYPE_NOTIFICATION_REGISTRATION = 30

◆ TYPE_NOTIFICATION_REGISTRATION_REQUEST

const ilSessionMembershipMailNotification::TYPE_NOTIFICATION_REGISTRATION_REQUEST = 31

◆ TYPE_NOTIFICATION_UNSUBSCRIBE

const ilSessionMembershipMailNotification::TYPE_NOTIFICATION_UNSUBSCRIBE = 32

◆ TYPE_REFUSED_SUBSCRIPTION_MEMBER

const ilSessionMembershipMailNotification::TYPE_REFUSED_SUBSCRIPTION_MEMBER = 23

◆ TYPE_SUBSCRIBE_MEMBER

const ilSessionMembershipMailNotification::TYPE_SUBSCRIBE_MEMBER = 28

◆ TYPE_UNBLOCKED_MEMBER

const ilSessionMembershipMailNotification::TYPE_UNBLOCKED_MEMBER = 26

◆ TYPE_UNSUBSCRIBE_MEMBER

const ilSessionMembershipMailNotification::TYPE_UNSUBSCRIBE_MEMBER = 27

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