ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilRegistrationMimeMailNotification.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/Mail/classes/class.ilMimeMailNotification.php';
5 require_once 'Services/Mail/classes/class.ilMail.php';
6 
14 {
16 
20  public function __construct()
21  {
23  }
24 
25  public function send()
26  {
27  switch($this->getType())
28  {
29  case self::TYPE_NOTIFICATION_ACTIVATION:
30 
31  $additional_information = $this->getAdditionalInformation();
35  $user = $additional_information['usr'];
36 
37  foreach($this->getRecipients() as $rcp)
38  {
39  try
40  {
41  $this->handleCurrentRecipient($rcp);
42  }
43  catch(ilMailException $e)
44  {
45  continue;
46  }
47 
48  $this->initMimeMail();
49 
50  $this->setSubject($this->getLanguage()->txt('reg_mail_subject_confirmation'));
51 
52  $this->setBody($this->getLanguage()->txt('reg_mail_body_salutation') . ' ' . $user->getFullname() . ',');
53  $this->appendBody("\n\n");
54  $this->appendBody($this->getLanguage()->txt('reg_mail_body_confirmation'));
55  $this->appendBody("\n");
56  $this->appendBody(ILIAS_HTTP_PATH . '/confirmReg.php?client_id=' . CLIENT_ID . '&rh=' . ilObjUser::_generateRegistrationHash($user->getId()));
57  $this->appendBody("\n\n");
58  $this->appendBody(sprintf(
59  $this->getLanguage()->txt('reg_mail_body_2_confirmation'),
60  ilFormat::_secondsToString($additional_information['hash_lifetime'], false, $this->getLanguage())
61  ));
62  $this->appendBody("\n\n");
63  $this->appendBody($this->getLanguage()->txt('reg_mail_body_3_confirmation'));
65 
66  $this->sendMimeMail($this->getCurrentRecipient());
67  }
68 
69  break;
70  }
71  }
72 }