Completed
Push — FVSv2 ( fdb1fd...10d7ab )
by Patrick
08:12
created

TwoShiftsAtOnceEmail   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 49
rs 10
c 0
b 0
f 0
wmc 7
lcom 1
cbo 2

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSubject() 0 4 1
A addLeads() 0 8 2
A getApprovalLink() 0 6 1
A getHTMLBody() 0 9 1
A getTextBody() 0 10 1
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