2020-11-26 15:48:35 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Mail;
|
|
|
|
|
|
2021-05-18 22:52:46 +02:00
|
|
|
use App\Lib\Utils;
|
|
|
|
|
use App\Models\Ticket;
|
2020-11-26 15:48:35 +01:00
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
|
|
|
|
|
class TicketUpdate extends Mailable
|
|
|
|
|
{
|
2021-05-18 22:52:46 +02:00
|
|
|
use Queueable;
|
|
|
|
|
use SerializesModels;
|
2020-11-26 15:48:35 +01:00
|
|
|
|
2021-05-18 22:52:46 +02:00
|
|
|
/** @var Ticket */
|
|
|
|
|
private $ticket;
|
|
|
|
|
|
|
|
|
|
/** @var string */
|
|
|
|
|
private $corpsMaj;
|
2020-11-26 15:48:35 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new message instance.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2021-05-18 22:52:46 +02:00
|
|
|
public function __construct(Ticket $ticket, string $corpsMaj)
|
2020-11-26 15:48:35 +01:00
|
|
|
{
|
|
|
|
|
$this->ticket = $ticket;
|
|
|
|
|
$this->corpsMaj = $corpsMaj;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Build the message.
|
|
|
|
|
*
|
|
|
|
|
* @return $this
|
|
|
|
|
*/
|
|
|
|
|
public function build()
|
|
|
|
|
{
|
|
|
|
|
$ticket = $this->ticket;
|
2021-05-18 22:52:46 +02:00
|
|
|
$corpsMaj = Utils::plainToHtml($this->corpsMaj);
|
2021-07-23 12:06:08 +02:00
|
|
|
return $this->subject("[SupportWeb] Le ticket n°" . $ticket->id . " à été mis à jour")
|
|
|
|
|
->view('emails.ticket-update', compact('ticket', 'corpsMaj'));
|
2020-11-26 15:48:35 +01:00
|
|
|
}
|
|
|
|
|
}
|