Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 6 |
DeduplicationMailableBase | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 6 |
__construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 4 |
|||
build | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
formatSubject | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
1 | <?php |
2 | |
3 | namespace Qmp\Laravel\Deduplication\Mail; |
4 | |
5 | use Illuminate\Bus\Queueable; |
6 | use Illuminate\Mail\Mailable; |
7 | use Illuminate\Queue\SerializesModels; |
8 | |
9 | class DeduplicationMailableBase extends Mailable |
10 | { |
11 | use Queueable, SerializesModels; |
12 | /** |
13 | * |
14 | */ |
15 | const SUBJECT_PREFIX = 'Qwamplify Performance'; |
16 | |
17 | /** |
18 | * Undocumented variable |
19 | * |
20 | * @var string |
21 | */ |
22 | protected $textViewSuffix = '_plain'; |
23 | |
24 | /** |
25 | * Undocumented variable |
26 | * |
27 | * @var string |
28 | */ |
29 | protected $subjectKey = 'campaign'; |
30 | |
31 | /** |
32 | * Create a new message instance. |
33 | * |
34 | * @return void |
35 | */ |
36 | public function __construct(array $data) |
37 | { |
38 | $this->viewData = $data; |
39 | $this->textView = $this->view . $this->textViewSuffix; |
40 | $this->subject = $this->formatSubject($data[$this->subjectKey]); |
41 | } |
42 | |
43 | /** |
44 | * Build the message. |
45 | * |
46 | * @return self |
47 | */ |
48 | public function build(): self |
49 | { |
50 | return $this; |
51 | } |
52 | /** |
53 | * Undocumented function |
54 | * |
55 | * @param [type] $type |
56 | * @param [type] $data |
57 | * @return void |
58 | */ |
59 | protected function formatSubject($customer) |
60 | { |
61 | return self::SUBJECT_PREFIX . " : " . sprintf($this->subject, $customer); |
62 | } |
63 | } |