ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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

Reimplemented from ilMailNotification.

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

223 {
224 parent::initLanguage($a_usr_id);
225 $this->getLanguage()->loadLanguageModule('sess');
226 }

References ilMailNotification\getLanguage().

Referenced by send().

+ 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.

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

References $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(), TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, TYPE_ADMISSION_MEMBER, TYPE_DISMISS_MEMBER, TYPE_NOTIFICATION_REGISTRATION_REQUEST, TYPE_REFUSED_SUBSCRIPTION_MEMBER, TYPE_SUBSCRIBE_MEMBER, and ilMailNotification\userToString().

+ 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

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

Referenced by send().

◆ TYPE_BLOCKED_MEMBER

const ilSessionMembershipMailNotification::TYPE_BLOCKED_MEMBER = 25

◆ TYPE_DISMISS_MEMBER

const ilSessionMembershipMailNotification::TYPE_DISMISS_MEMBER = 21

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

Referenced by send().

◆ TYPE_NOTIFICATION_REGISTRATION

const ilSessionMembershipMailNotification::TYPE_NOTIFICATION_REGISTRATION = 30

◆ TYPE_NOTIFICATION_REGISTRATION_REQUEST

const ilSessionMembershipMailNotification::TYPE_NOTIFICATION_REGISTRATION_REQUEST = 31

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

Referenced by send().

◆ 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

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

Referenced by send().

◆ 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: