ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilRegistrationMailNotification.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
14{
17
18
23 public function __construct()
24 {
25 parent::__construct();
26 }
27
32 public function send()
33 {
34 switch($this->getType())
35 {
37
38 foreach($this->getRecipients() as $rcp)
39 {
40 $this->initLanguage($rcp);
41 $this->initMail();
42 $this->setSubject(
43 $this->getLanguageText('reg_mail_new_user')
44 );
45
46 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
47 $this->appendBody("\n\n");
48
49 $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
50 $this->appendBody("\n\n");
51 $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
52
54
55 $this->appendBody("\n\n");
56 $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
57
58 $this->appendBody("\n\n");
59 $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
60
61 $this->getMail()->appendInstallationSignature(true);
62 $this->getMail()->enableSoap(false);
63 $this->sendMail(array($rcp),array('system'));
64 }
65 break;
66
68
69 foreach($this->getRecipients() as $rcp)
70 {
71 $this->initLanguage($rcp);
72 $this->initMail();
73 $this->setSubject(
74 $this->getLanguageText('reg_mail_new_user_confirmation')
75 );
76
77 $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
78 $this->appendBody("\n\n");
79
80 $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
81 $this->appendBody("\n\n");
82 $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
83
85
86 $this->appendBody("\n\n");
87 $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
88
89 $this->appendBody("\n\n");
90 $this->appendBody($this->getLanguageText('reg_mail_body_confirmation'));
91 $this->appendBody("\n"); // #4527
92 include_once "Services/Link/classes/class.ilLink.php";
93 $this->appendBody(ilLink::_getStaticLink($info['usr']->getId(), "usrf"));
94
95 $this->appendBody("\n\n");
96 $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
97
98 $this->getMail()->appendInstallationSignature(true);
99 $this->getMail()->enableSoap(false);
100 $this->sendMail(array($rcp),array('system'));
101 }
102 break;
103 }
104 }
105
111 protected function initLanguage($a_usr_id)
112 {
113 parent::initLanguage($a_usr_id);
114 $this->getLanguage()->loadLanguageModule('registration');
115 }
116
117}
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
static getSalutation($a_usr_id, $a_language=null)
Get salutation.
initLanguage($a_usr_id)
Add language module registration.
$info
Definition: example_052.php:80