TwoShiftsAtOnceEmail::getTextBody()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
namespace Emails;
3
4
class TwoShiftsAtOnceEmail extends VolunteerEmail
5
{
6
    public function __construct($userProfile)
7
    {
8
        parent::__construct($userProfile);
9
    }
10
11
    public function getSubject()
12
    {
13
        return 'Burning Flipside: Volunteer Signed up for two shifts at once';
14
    }
15
16
    public function addLeads($leads)
17
    {
18
        $count = count($leads);
19
        for($i = 0; $i < $count; $i++)
20
        {
21
            $this->addToAddress($leads[$i]);
22
        }
23
    }
24
25
    protected function getApprovalLink()
26
    {
27
        $settings = \Settings::getInstance();
28
        $profilesUrl = $settings->getGlobalSetting('secure_url', 'https://secure.burningflipside.com');
29
        return $profilesUrl.'/fvs/_admin/pending.php';
30
    }
31
32
    public function getHTMLBody()
33
    {
34
        return 'You are recieving this message because you are a lead for a Burning Flipside department.<br/>
35
                A volunteer with the name '.$this->profile->getDisplayName('paperName').' has signed up for two shifts at once, at least one of which is in your department.<br/>
36
                This requires explicit approval or disapproval from you. You can provide that by following <a href="'.$this->getApprovalLink().'">this link</a>.<br/>
37
                If you take no action the shifts will remain in a pending state, which means no one else can sign up for them, but the volunteer is not sure if they have the shifts or not.<br/>
38
                Thank you,<br/>
39
                Burning Flipside Volunteer Team';
40
    }
41
42
    public function getTextBody()
43
    {
44
        return 'You are recieving this message because you are a lead for a Burning Flipside department.
45
                A volunteer with the name '.$this->profile->getDisplayName('paperName').' has signed up for two shifts at once, at least one of which is in your department.
46
                This requires explicit approval or disapproval from you. You can provide that by following the link below.
47
                '.$this->getApprovalLink().'
48
                If you take no action the shifts will remain in a pending state, which means no one else can sign up for them, but the volunteer is not sure if they have the shifts or not.
49
                Thank you,
50
                Burning Flipside Volunteer Team';
51
    }
52
}
53
/* vim: set tabstop=4 shiftwidth=4 expandtab: */
54