ldc-crm/app/Mail/CourrierArcadiaError.php

56 lines
1 KiB
PHP
Raw Normal View History

2021-02-19 16:32:08 +01:00
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class CourrierArcadiaError extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
2021-02-19 16:32:08 +01:00
public $subject;
2021-03-14 10:45:42 +01:00
public $msg;
2021-03-14 10:45:42 +01:00
public $xml;
2021-02-19 16:32:08 +01:00
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($subject, $msg, $xml)
{
$this->subject = $subject;
2021-03-14 10:45:42 +01:00
$this->msg = $msg;
$this->xml = $xml;
2021-02-19 16:32:08 +01:00
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$msg = $this->msg;
2021-03-14 10:45:42 +01:00
return $this->subject(
sprintf(
"[LDC CRM] %s",
$this->subject
)
)->view(
'mail.arcadia-error',
compact('msg')
)->attachData(
$this->xml,
date("Ymd_His") . '.xml',
['mime' => 'application/xml']
);
2021-02-19 16:32:08 +01:00
}
}