ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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()) {
36
37 foreach ($this->getRecipients() as $rcp) {
38 $this->initLanguage($rcp);
39 $this->initMail();
40 $this->setSubject(
41 $this->getLanguageText('reg_mail_new_user')
42 );
43
44 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
45 $this->appendBody("\n\n");
46
47 $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
48 $this->appendBody("\n\n");
49 $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
50
52
53 $this->appendBody("\n\n");
54 $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
55
56 $this->appendBody("\n\n");
57 $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
58
59 $this->getMail()->appendInstallationSignature(true);
60 $this->getMail()->enableSoap(false);
61 $this->sendMail(array($rcp), array('system'));
62 }
63 break;
64
66
67 foreach ($this->getRecipients() as $rcp) {
68 $this->initLanguage($rcp);
69 $this->initMail();
70 $this->setSubject(
71 $this->getLanguageText('reg_mail_new_user_confirmation')
72 );
73
74 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
75 $this->appendBody("\n\n");
76
77 $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
78 $this->appendBody("\n\n");
79 $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
80
82
83 $this->appendBody("\n\n");
84 $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
85
86 $this->appendBody("\n\n");
87 $this->appendBody($this->getLanguageText('reg_mail_body_confirmation'));
88 $this->appendBody("\n"); // #4527
89 include_once "Services/Link/classes/class.ilLink.php";
90 $this->appendBody(ilLink::_getStaticLink($info['usr']->getId(), "usrf"));
91
92 $this->appendBody("\n\n");
93 $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
94
95 $this->getMail()->appendInstallationSignature(true);
96 $this->getMail()->enableSoap(false);
97 $this->sendMail(array($rcp), array('system'));
98 }
99 break;
100 }
101 }
102
108 protected function initLanguage($a_usr_id)
109 {
110 parent::initLanguage($a_usr_id);
111 $this->getLanguage()->loadLanguageModule('registration');
112 }
113}
An exception for terminatinating execution or to throw for unit testing.
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, ilLanguage $a_language=null)
initLanguage($a_usr_id)
Add language module registration.
$info
Definition: index.php:5