ILIAS  release_7 Revision v7.30-3-g800a261c036
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 {
23 }
24
25 public function send()
26 {
27 switch ($this->getType()) {
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}
An exception for terminatinating execution or to throw for unit testing.
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
Class ilMailException.
appendBody($a_body)
Append body text.
getType()
Get notification type.
getRecipients()
get array of recipients
static _getInstallationSignature()
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.
const CLIENT_ID
Definition: constants.php:39
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
catch(ilCmiXapiException $e) send($response)
Definition: xapitoken.php:82