50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Mail;
|
||
|
|
|
||
|
|
use App\Models\MailContactData;
|
||
|
|
use Illuminate\Bus\Queueable;
|
||
|
|
use Illuminate\Queue\SerializesModels;
|
||
|
|
|
||
|
|
class ContactComplainMail extends ContactMail
|
||
|
|
{
|
||
|
|
use Queueable;
|
||
|
|
use SerializesModels;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The order instance.
|
||
|
|
*
|
||
|
|
* @var MailContactData
|
||
|
|
*/
|
||
|
|
protected $data;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Create a new message instance.
|
||
|
|
*
|
||
|
|
* @return void
|
||
|
|
*/
|
||
|
|
public function __construct(MailContactData $data)
|
||
|
|
{
|
||
|
|
$this->data = $data;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Build the message.
|
||
|
|
*
|
||
|
|
* @return $this
|
||
|
|
*/
|
||
|
|
public function build()
|
||
|
|
{
|
||
|
|
$this->joinFileIfProvided();
|
||
|
|
return $this->view('emails.contact')
|
||
|
|
->subject(sprintf('Nouveau message consommateur Le Gaulois (%s)', $this->data->type->label))
|
||
|
|
->text('emails.contact-plain')
|
||
|
|
->with('data', $this->data)
|
||
|
|
->attachData(
|
||
|
|
view('emails.passerelle-xml', ['data' => $this->data->exportToPasserelleDataArray()])->render(),
|
||
|
|
sprintf('LEGAULOIS_PASS_MESSAGE_%d.xml', date("YmdHis")),
|
||
|
|
['mime' => 'application/xml']
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|