ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilSessionMembershipMailNotification.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once './Services/Mail/classes/class.ilMailNotification.php';
5
13{
16
19
20
23
26
30
31
35 public function __construct()
36 {
37 parent::__construct();
38 }
39
44 public function send()
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 }
216
222 protected function initLanguage($a_usr_id)
223 {
224 parent::initLanguage($a_usr_id);
225 $this->getLanguage()->loadLanguageModule('sess');
226 }
227
228
229}
230?>
Base class for course/group mail notifications.
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