ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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  case self::TYPE_NOTIFICATION_ACTIVATION:
29 
30  $additional_information = $this->getAdditionalInformation();
34  $user = $additional_information['usr'];
35  $this->getLanguage()->loadLanguageModule("registration");
36 
37  foreach ($this->getRecipients() as $rcp) {
38  try {
39  $this->handleCurrentRecipient($rcp);
40  } catch (ilMailException $e) {
41  continue;
42  }
43 
44  $this->initMimeMail();
45 
46  $this->setSubject($this->getLanguage()->txt('reg_mail_subject_confirmation'));
47 
48  $this->setBody($this->getLanguage()->txt('reg_mail_body_salutation') . ' ' . $user->getFullname() . ',');
49  $this->appendBody("\n\n");
50  $this->appendBody($this->getLanguage()->txt('reg_mail_body_activation'));
51  $this->appendBody("\n");
52  $this->appendBody(ILIAS_HTTP_PATH . '/confirmReg.php?client_id=' . CLIENT_ID . '&rh=' . ilObjUser::_generateRegistrationHash($user->getId()));
53  $this->appendBody("\n\n");
54  $this->appendBody(sprintf(
55  $this->getLanguage()->txt('reg_mail_body_2_confirmation'),
56  ilDatePresentation::secondsToString($additional_information['hash_lifetime'], false, $this->getLanguage())
57  ));
58  $this->appendBody("\n\n");
59  $this->appendBody($this->getLanguage()->txt('reg_mail_body_3_confirmation'));
61 
62  $this->sendMimeMail($this->getCurrentRecipient());
63  }
64 
65  break;
66  }
67  }
68 }
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.
static _getInstallationSignature()