Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
90.00% |
9 / 10 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
RabbitEmail | |
90.00% |
9 / 10 |
|
66.67% |
2 / 3 |
3.01 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
build | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 | |||
attachments | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
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 RabbitEmail extends Mailable |
10 | { |
11 | use Queueable, SerializesModels; |
12 | |
13 | public string $email_data; |
14 | |
15 | public string $email_error; |
16 | |
17 | /** |
18 | * Create a new message instance. |
19 | * |
20 | * @param string $data |
21 | * @param string $error |
22 | * |
23 | */ |
24 | public function __construct(string $data, string $error = '') |
25 | { |
26 | $this->email_data = $data; |
27 | $this->email_error = $error; |
28 | } |
29 | |
30 | /** |
31 | * Get the message content definition. |
32 | * |
33 | * @return RabbitEmail |
34 | */ |
35 | public function build(): RabbitEmail |
36 | { |
37 | return $this->from(env('MAIL_USERNAME'), env('MAIL_FROM_NAME')) |
38 | ->subject('Rabbit notice') |
39 | ->view('mail.rabbit') |
40 | ->with([ |
41 | 'email_data' => $this->email_data, |
42 | 'email_error' => $this->email_error |
43 | ]); |
44 | } |
45 | |
46 | /** |
47 | * Get the attachments for the message. |
48 | * |
49 | * @return array |
50 | */ |
51 | public function attachments(): array |
52 | { |
53 | return []; |
54 | } |
55 | |
56 | } |