Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 17 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| CourrierArcadiaError | |
0.00% |
0 / 17 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| build | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Mail; |
| 4 | |
| 5 | use Illuminate\Bus\Queueable; |
| 6 | use Illuminate\Contracts\Queue\ShouldQueue; |
| 7 | use Illuminate\Mail\Mailable; |
| 8 | use Illuminate\Queue\SerializesModels; |
| 9 | |
| 10 | class CourrierArcadiaError extends Mailable implements ShouldQueue |
| 11 | { |
| 12 | use Queueable; |
| 13 | use SerializesModels; |
| 14 | |
| 15 | /** @var string */ |
| 16 | public $subject; |
| 17 | |
| 18 | /** @var string */ |
| 19 | public $msg; |
| 20 | |
| 21 | /** @var string */ |
| 22 | public $xml; |
| 23 | |
| 24 | /** |
| 25 | * Create a new message instance. |
| 26 | * |
| 27 | * @param string $subject |
| 28 | * @param string $msg |
| 29 | * @param string $xml |
| 30 | * @return void |
| 31 | */ |
| 32 | public function __construct(string $subject, string $msg, string $xml) |
| 33 | { |
| 34 | $this->subject = $subject; |
| 35 | $this->msg = $msg; |
| 36 | $this->xml = $xml; |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Build the message. |
| 41 | * |
| 42 | * @return \Illuminate\Mail\Mailable |
| 43 | */ |
| 44 | public function build(): \Illuminate\Mail\Mailable |
| 45 | { |
| 46 | $msg = $this->msg; |
| 47 | return $this->subject( |
| 48 | sprintf( |
| 49 | "[LDC CRM] %s", |
| 50 | $this->subject |
| 51 | ) |
| 52 | )->view( |
| 53 | 'mail.arcadia-error', |
| 54 | compact('msg') |
| 55 | )->attachData( |
| 56 | $this->xml, |
| 57 | date("Ymd_His") . '.xml', |
| 58 | ['mime' => 'application/xml'] |
| 59 | ); |
| 60 | } |
| 61 | } |