ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
4require_once 'Services/Mail/classes/class.ilMimeMailNotification.php';
5require_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 {
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 ilFormat::_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'));
66
67 $this->sendMimeMail($this->getCurrentRecipient());
68 }
69
70 break;
71 }
72 }
73}
_secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
ILIAS Exception for Service Mail.
appendBody($a_body)
Append body text.
getType()
Get notification type.
getRecipients()
get array of recipients
static _getInstallationSignature()
Static getter for the installation signature.
Base class for mime mail notifications.
static _generateRegistrationHash($a_usr_id)
Generates a unique hashcode for activating a user profile after registration.
Class for mime mail registration notifications.