ldc-supportweb/app/Mail/NewTicket.php

41 lines
1.1 KiB
PHP
Raw Normal View History

<?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
{
2021-07-23 12:06:08 +02:00
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,
]);
}
}