Completed
Push — master ( 75fca3...057bf7 )
by Fèvre
22s queued 10s
created

ContactMailer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A contact() 0 9 2
1
<?php
2
namespace App\Mailer;
3
4
use Cake\Core\Configure;
5
use Cake\Mailer\Mailer;
6
7
class ContactMailer extends Mailer
8
{
9
    /**
10
     * Contact Email.
11
     *
12
     * @param array $viewVars The variables to pass to the view.
13
     *
14
     * @return void
15
     */
16
    public function contact($viewVars = [])
17
    {
18
        $this
19
            ->emailFormat('html')
20
            ->from(['[email protected]' => 'Contact Form'])
21
            ->to(Configure::read('Site.contact_email'))
22
            ->subject(isset($viewVars['subject']) ? $viewVars['subject'] : 'Someone has contacted you')
23
            ->set($viewVars);
24
    }
25
}
26