Test Setup Failed
Push — master ( c2712b...265b39 )
by Davide
16:34
created

ExpiringEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace App\Mail;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Mail\Mailable;
7
use Illuminate\Queue\SerializesModels;
8
9
class ExpiringEvent extends Mailable
10
{
11
    use Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Mail\ExpiringEvent: $id, $relations, $class, $keyBy
Loading history...
12
13
    /**
14
     * The report instance.
15
     *
16
     * @var array
17
     */
18
    protected $report;
19
20
    /**
21
     * Create a new message instance.
22
     *
23
     * @return void
24
     */
25
    public function __construct($report)
26
    {
27
        $this->report = $report;
28
    }
29
30
    /**
31
     * Build the message.
32
     *
33
     * @return $this
34
     */
35
    public function build()
36
    {
37
        // Configure email parameters in .env file
38
39
        return $this->markdown('emails.expiringevent')
40
                ->to($this->report['emailTo'])
41
                ->from($this->report['emailFrom'], $this->report['senderName'])
42
                ->replyTo($this->report['emailFrom'], $this->report['senderName'])
43
                ->subject($this->report['subject'])
44
                ->with([
45
                    'user_name' => $this->report['user_name'],
46
                    'event_title' => $this->report['event_title'],
47
                    'sender_email' => $this->report['emailFrom'],
48
                    'sender_name' => $this->report['senderName'],
49
                    //'msg' => $this->report['message'],
50
                ]);
51
    }
52
}
53