ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
4 include_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())
35  {
36  case self::TYPE_NOTIFICATION_APPROVERS:
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 
53  $info = $this->getAdditionalInformation();
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 
67  case self::TYPE_NOTIFICATION_CONFIRMATION:
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')
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 
84  $info = $this->getAdditionalInformation();
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 
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 
114 }