ContactMailer::contact()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 2
eloc 7
nc 1
nop 1
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
0 ignored issues
show
Deprecated Code introduced by
The method Cake\Mailer\Email::from() has been deprecated with message: 3.4.0 Use setFrom()/getFrom() instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
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