Files
portal-api/app/Mail/TicketCreated.php
T
baodev0 0b08689ea4 feat: harden admin auth and ticket workflows
- add rotating admin refresh tokens and password gates\n- expand ticket galleries, exports, and client resources\n- improve IP allocation auditing and dashboard data\n- enforce encrypted client access tokens on public routes
2026-10-16 17:00:55 +07:00

43 lines
1.1 KiB
PHP

<?php
namespace App\Mail;
use App\Support\EmailTemplateShell;
use App\Support\MailGlobals;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\SerializesModels;
class TicketCreated extends TemplateMailable implements ShouldQueue
{
use Queueable, SerializesModels;
public function __construct(
public readonly mixed $ticket,
public readonly mixed $customer,
) {}
public function attachments(): array
{
return [];
}
protected function scenario(): string
{
return 'ticket_created';
}
protected function variables(): array
{
$room = $this->ticket->roomLabel();
return [
'full_name' => $this->customer->fullname ?: 'Quý khách',
'ticket_num' => $this->ticket->ticket_num,
'subject' => $this->ticket->subject,
'room_row' => $room ? EmailTemplateShell::row('Phòng ban', e($room)) : '',
'ticket_url' => MailGlobals::frontendUrl() . '/tickets/' . $this->ticket->ticket_num,
];
}
}