ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 216 of file class.ilSessionMembershipMailNotification.php.

References ilMailNotification\getLanguage().

Referenced by send().

217  {
218  parent::initLanguage($a_usr_id);
219  $this->getLanguage()->loadLanguageModule('sess');
220  }
+ 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 $DIC, $ilSetting, $info, ilMailNotification\appendBody(), 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 $DIC;
47 
48  $ilSetting = $DIC['ilSetting'];
49 
50  // parent::send();
51 
52  switch ($this->getType()) {
53  case self::TYPE_ADMISSION_MEMBER:
54 
55  // automatic mails about status change disabled
56  if (!$ilSetting->get('mail_grp_member_notification', false)) {
57  return;
58  }
59 
60  foreach ($this->getRecipients() as $rcp) {
61  $this->initLanguage($rcp);
62  $this->initMail();
63  $this->setSubject(
64  sprintf($this->getLanguageText('grp_mail_admission_new_sub'), $this->getObjectTitle(true))
65  );
66  $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
67  $this->appendBody("\n\n");
68  $this->appendBody(
69  sprintf($this->getLanguageText('grp_mail_admission_new_bod'), $this->getObjectTitle())
70  );
71  $this->appendBody("\n\n");
72  $this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
73  $this->appendBody("\n\n");
74  $this->appendBody($this->createPermanentLink());
75  $this->getMail()->appendInstallationSignature(true);
76 
77  $this->sendMail(array($rcp), array('system'));
78  }
79  break;
80 
81  case self::TYPE_DISMISS_MEMBER:
82 
83  // automatic mails about status change disabled
84  if (!$ilSetting->get('mail_grp_member_notification', false)) {
85  return;
86  }
87 
88  foreach ($this->getRecipients() as $rcp) {
89  $this->initLanguage($rcp);
90  $this->initMail();
91  $this->setSubject(
92  sprintf($this->getLanguageText('grp_mail_dismiss_sub'), $this->getObjectTitle(true))
93  );
94  $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
95  $this->appendBody("\n\n");
96  $this->appendBody(
97  sprintf($this->getLanguageText('grp_mail_dismiss_bod'), $this->getObjectTitle())
98  );
99  $this->getMail()->appendInstallationSignature(true);
100  $this->sendMail(array($rcp), array('system'));
101  }
102  break;
103 
104 
105 
106 
107  case self::TYPE_SUBSCRIBE_MEMBER:
108 
109  foreach ($this->getRecipients() as $rcp) {
110  $this->initLanguage($rcp);
111  $this->initMail();
112  $this->setSubject(
113  sprintf($this->getLanguageText('grp_mail_subscribe_member_sub'), $this->getObjectTitle(true))
114  );
115  $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
116  $this->appendBody("\n\n");
117  $this->appendBody(
118  sprintf($this->getLanguageText('grp_mail_subscribe_member_bod'), $this->getObjectTitle())
119  );
120 
121  $this->appendBody("\n\n");
122  $this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
123  $this->appendBody("\n\n");
124  $this->appendBody($this->createPermanentLink());
125  $this->getMail()->appendInstallationSignature(true);
126 
127  $this->sendMail(array($rcp), array('system'));
128  }
129  break;
130 
131 
132  case self::TYPE_NOTIFICATION_REGISTRATION_REQUEST:
133 
134  foreach ($this->getRecipients() as $rcp) {
135  $this->initLanguage($rcp);
136  $this->initMail();
137  $this->setSubject(
138  sprintf($this->getLanguageText('grp_mail_notification_reg_req_sub'), $this->getObjectTitle(true))
139  );
140  $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
141  $this->appendBody("\n\n");
142 
143  $info = $this->getAdditionalInformation();
144  $this->appendBody(
145  sprintf(
146  $this->getLanguageText('grp_mail_notification_reg_req_bod'),
147  $this->userToString($info['usr_id']),
148  $this->getObjectTitle()
149  )
150  );
151  $this->appendBody("\n\n");
152  $this->appendBody($this->getLanguageText('grp_mail_notification_reg_req_bod2'));
153  $this->appendBody("\n");
154  $this->appendBody($this->createPermanentLink(array(), '_mem'));
155 
156  $this->appendBody("\n\n");
157  $this->appendBody($this->getLanguageText('grp_notification_explanation_admin'));
158 
159  $this->getMail()->appendInstallationSignature(true);
160  $this->sendMail(array($rcp), array('system'));
161  }
162  break;
163 
164  case self::TYPE_REFUSED_SUBSCRIPTION_MEMBER:
165 
166  foreach ($this->getRecipients() as $rcp) {
167  $this->initLanguage($rcp);
168  $this->initMail();
169  $this->setSubject(
170  sprintf($this->getLanguageText('sess_mail_sub_dec_sub'), $this->getObjectTitle(true))
171  );
172  $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
173  $this->appendBody("\n\n");
174  $this->appendBody(
175  sprintf($this->getLanguageText('sess_mail_sub_dec_bod'), $this->getObjectTitle())
176  );
177 
178  $this->getMail()->appendInstallationSignature(true);
179 
180  $this->sendMail(array($rcp), array('system'));
181  }
182  break;
183 
184  case self::TYPE_ACCEPTED_SUBSCRIPTION_MEMBER:
185 
186  foreach ($this->getRecipients() as $rcp) {
187  $this->initLanguage($rcp);
188  $this->initMail();
189  $this->setSubject(
190  sprintf($this->getLanguageText('sess_mail_sub_acc_sub'), $this->getObjectTitle(true))
191  );
192  $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
193  $this->appendBody("\n\n");
194  $this->appendBody(
195  sprintf($this->getLanguageText('sess_mail_sub_acc_bod'), $this->getObjectTitle())
196  );
197  $this->appendBody("\n\n");
198  $this->appendBody($this->getLanguageText('sess_mail_permanent_link'));
199  $this->appendBody("\n\n");
200  $this->appendBody($this->createPermanentLink());
201  $this->getMail()->appendInstallationSignature(true);
202 
203  $this->sendMail(array($rcp), array('system'));
204  }
205  break;
206 
207  }
208  return true;
209  }
getType()
Get notification type.
global $DIC
Definition: saml.php:7
getObjectTitle($a_shorten=false)
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: