Completed
Push — master ( b9683e...3482b2 )
by Patrick
06:20
created

PasswordResetEmail::getTextBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
require_once('class.FlipsideProfileEmail.php');
3
4
class PasswordResetEmail extends FlipsideProfileEmail
5
{
6
    public function __construct($user)
7
    {
8
        parent::__construct($user);
9
        $this->addToAddress($user->mail, $user->displayName);
10
    }
11
12
    public function getSubject()
13
    {
14
        return 'Burning Flipside Password Reset';
15
    }
16
17
    protected function getResetLink()
18
    {
19
        $settings = \Settings::getInstance();
20
        $profilesUrl = $settings->getGlobalSetting('profiles_url', 'https://profiles.burningflipside.com/');
21
        return $profilesUrl.'/change.php?hash='.$this->user->getPasswordResetHash();
22
    }
23
24
    public function getHTMLBody()
25
    {
26
        return 'Someone (quite possibly you) has requested a password reset of your Flipside account.<br/>
27
                To reset your password click on the link below.<br/>
28
                <a href="'.$this->getResetLink().'">Reset Password</a><br/>
29
                If you did not request this reset, don\'t worry. This email was sent only to you and your password has not been changed.<br/>
30
                If you receive many of these requests, you can notify the technology team ([email protected]).<br/>
31
                Thank you,<br/>
32
                Burning Flipside Technology Team';
33
    }
34
35
    public function getTextBody()
36
    {
37
        return 'Someone (quite possibly you) has requested a password reset of your Flipside account.
38
                To reset your password copy the following URL into your browser.
39
                '.$this->getResetLink().'
40
                If you did not request this reset, don\'t worry. This email was sent only to you and your password has not been changed.
41
                If you receive many of these requests, you can notify the technology team ([email protected]).
42
                Thank you,
43
                Burning Flipside Technology Team';
44
    }
45
}
46
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
47