ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 {
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
51 $info = $this->getAdditionalInformation();
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->sendMail(array($rcp));
61 }
62 break;
63
65
66 foreach ($this->getRecipients() as $rcp) {
67 $this->initLanguage($rcp);
68 $this->initMail();
69 $this->setSubject(
70 $this->getLanguageText('reg_mail_new_user_confirmation')
71 );
72
73 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
74 $this->appendBody("\n\n");
75
76 $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
77 $this->appendBody("\n\n");
78 $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
79
80 $info = $this->getAdditionalInformation();
81
82 $this->appendBody("\n\n");
83 $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
84
85 $this->appendBody("\n\n");
86 $this->appendBody($this->getLanguageText('reg_mail_body_confirmation'));
87 $this->appendBody("\n"); // #4527
88 include_once "Services/Link/classes/class.ilLink.php";
89 $this->appendBody(ilLink::_getStaticLink($info['usr']->getId(), "usrf"));
90
91 $this->appendBody("\n\n");
92 $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
93
94 $this->getMail()->appendInstallationSignature(true);
95 $this->sendMail(array($rcp));
96 }
97 break;
98 }
99 }
100
106 protected function initLanguage($a_usr_id)
107 {
108 parent::initLanguage($a_usr_id);
109 $this->getLanguage()->loadLanguageModule('registration');
110 }
111}
An exception for terminatinating execution or to throw for unit testing.
Base class for course/group mail notifications.
appendBody($a_body)
Append body text.
getType()
Get notification type.
sendMail(array $a_rcp, $a_parse_recipients=true)
getRecipients()
get array of recipients
static getSalutation($a_usr_id, ilLanguage $a_language=null)
initLanguage($a_usr_id)
Add language module registration.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc