40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Enums\Tickets\TicketTypeEnum;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
class NewTicket extends Mailable implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
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,
|
|
) {}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
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,
|
|
]);
|
|
}
|
|
}
|