ldc-supportweb/app/Mail/TicketUpdate.php

46 lines
940 B
PHP
Raw Normal View History

<?php
namespace App\Mail;
2021-05-18 22:52:46 +02:00
use App\Lib\Utils;
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class TicketUpdate extends Mailable
{
2021-05-18 22:52:46 +02:00
use Queueable;
use SerializesModels;
2021-05-18 22:52:46 +02:00
/** @var Ticket */
private $ticket;
/** @var string */
private $corpsMaj;
/**
* Create a new message instance.
*
* @return void
*/
2021-05-18 22:52:46 +02:00
public function __construct(Ticket $ticket, string $corpsMaj)
{
$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);
return $this->subject("[SupportWeb][{$ticket->site->name}] Ticket n°$ticket->id")
2021-07-23 12:06:08 +02:00
->view('emails.ticket-update', compact('ticket', 'corpsMaj'));
}
}