ldc-legaulois/app/Mail/ContactComplainMail.php

31 lines
890 B
PHP
Raw Normal View History

2024-10-04 17:24:15 +02:00
<?php
namespace App\Mail;
use App\Models\MailContactData;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Attachment;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\File;
class ContactComplainMail extends ContactMail
{
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->view('emails.contact-passerelle')
2024-10-04 17:24:15 +02:00
->subject(sprintf('Nouveau message consommateur Le Gaulois (%s)', $this->data->type->label()))
->text('emails.contact-passerelle-plain')
2024-10-04 17:24:15 +02:00
->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']
);
}
}