2020-11-25 16:05:21 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Mail;
|
|
|
|
|
|
2026-06-24 16:25:58 +02:00
|
|
|
use App\Enums\Tickets\TicketTypeEnum;
|
2020-11-25 16:05:21 +01:00
|
|
|
use Illuminate\Bus\Queueable;
|
2026-06-24 16:25:58 +02:00
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
2020-11-25 16:05:21 +01:00
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
|
|
2026-06-24 16:25:58 +02:00
|
|
|
class NewTicket extends Mailable implements ShouldQueue
|
2020-11-25 16:05:21 +01:00
|
|
|
{
|
2021-07-23 12:06:08 +02:00
|
|
|
use Queueable;
|
2020-11-25 16:05:21 +01:00
|
|
|
|
2026-06-24 16:25:58 +02:00
|
|
|
public function __construct(
|
|
|
|
|
private readonly int $ticketId,
|
|
|
|
|
private readonly string $siteName,
|
|
|
|
|
private readonly string $ticketTitle,
|
|
|
|
|
private readonly TicketTypeEnum $ticketType,
|
|
|
|
|
private readonly string $userName,
|
|
|
|
|
private readonly string $ticketDescription,
|
|
|
|
|
) {}
|
2020-11-25 16:05:21 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Build the message.
|
|
|
|
|
*
|
|
|
|
|
* @return $this
|
|
|
|
|
*/
|
|
|
|
|
public function build()
|
|
|
|
|
{
|
2026-06-24 16:25:58 +02:00
|
|
|
return $this->subject("[Support] Nouveau ticket n° {$this->ticketId} - {$this->ticketTitle}")
|
|
|
|
|
->view('emails.new-ticket', [
|
|
|
|
|
'ticketId' => $this->ticketId,
|
|
|
|
|
'siteName' => $this->siteName,
|
|
|
|
|
'ticketTitle' => $this->ticketTitle,
|
|
|
|
|
'ticketType' => $this->ticketType,
|
|
|
|
|
'userName' => $this->userName,
|
|
|
|
|
'ticketDescription' => $this->ticketDescription,
|
|
|
|
|
]);
|
2020-11-25 16:05:21 +01:00
|
|
|
}
|
|
|
|
|
}
|