ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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
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}
_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.
getLanguage()
get language object
getAdditionalInformation()
Get additional information for generating notification mails.
setBody($a_body)
Set mail body.
getRecipients()
get array of recipients
setSubject($a_subject)
Set mail subject.
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.