- Make all tests pass Client (V4),CRMV2,CRMV4 - Simplify client submodule path - Move App_url to .env.testing
61 lines
1.3 KiB
PHP
61 lines
1.3 KiB
PHP
<?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;
|
|
|
|
/** @var string */
|
|
public $subject;
|
|
|
|
/** @var string */
|
|
public $msg;
|
|
|
|
/** @var string */
|
|
public $xml;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @param string $subject
|
|
* @param string $msg
|
|
* @param string $xml
|
|
* @return void
|
|
*/
|
|
public function __construct(string $subject, string $msg, string $xml)
|
|
{
|
|
$this->subject = $subject;
|
|
$this->msg = $msg;
|
|
$this->xml = $xml;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return \Illuminate\Mail\Mailable
|
|
*/
|
|
public function build(): \Illuminate\Mail\Mailable
|
|
{
|
|
$msg = $this->msg;
|
|
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']
|
|
);
|
|
}
|
|
}
|