PasswordResetEmail::getSubject()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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