ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
22  parent::__construct();
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  $this->getLanguage()->loadLanguageModule("registration");
37 
38  foreach($this->getRecipients() as $rcp)
39  {
40  try
41  {
42  $this->handleCurrentRecipient($rcp);
43  }
44  catch(ilMailException $e)
45  {
46  continue;
47  }
48 
49  $this->initMimeMail();
50 
51  $this->setSubject($this->getLanguage()->txt('reg_mail_subject_confirmation'));
52 
53  $this->setBody($this->getLanguage()->txt('reg_mail_body_salutation') . ' ' . $user->getFullname() . ',');
54  $this->appendBody("\n\n");
55  $this->appendBody($this->getLanguage()->txt('reg_mail_body_activation'));
56  $this->appendBody("\n");
57  $this->appendBody(ILIAS_HTTP_PATH . '/confirmReg.php?client_id=' . CLIENT_ID . '&rh=' . ilObjUser::_generateRegistrationHash($user->getId()));
58  $this->appendBody("\n\n");
59  $this->appendBody(sprintf(
60  $this->getLanguage()->txt('reg_mail_body_2_confirmation'),
61  ilDatePresentation::secondsToString($additional_information['hash_lifetime'], false, $this->getLanguage())
62  ));
63  $this->appendBody("\n\n");
64  $this->appendBody($this->getLanguage()->txt('reg_mail_body_3_confirmation'));
65  $this->appendBody(ilMail::_getInstallationSignature());
66 
67  $this->sendMimeMail($this->getCurrentRecipient());
68  }
69 
70  break;
71  }
72  }
73 }
getType()
Get notification type.
Class for mime mail registration notifications.
Class ilMailException.
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
getRecipients()
get array of recipients
Base class for mime mail notifications.
static _generateRegistrationHash($a_usr_id)
Generates a unique hashcode for activating a user profile after registration.
appendBody($a_body)
Append body text.