35 lines
1.2 KiB
PHP
35 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Mail\Admin;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class TicketAdminNotification extends Mailable implements ShouldQueue
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public function __construct(
|
|
public readonly mixed $ticket,
|
|
public readonly mixed $customer,
|
|
) {}
|
|
|
|
public function build(): static
|
|
{
|
|
return $this
|
|
->subject("[ADMIN] Ticket mới #{$this->ticket->ticket_num} — {$this->customer->email}")
|
|
->view('emails.admin.ticket-notification')
|
|
->with([
|
|
'ticketNum' => $this->ticket->ticket_num,
|
|
'subject' => $this->ticket->subject,
|
|
'room' => $this->ticket->room,
|
|
'description' => strip_tags($this->ticket->description),
|
|
'customerName' => trim($this->customer->firstname . ' ' . $this->customer->lastname),
|
|
'customerEmail' => $this->customer->email,
|
|
'ticketUrl' => config('app.frontend_url') . '/tickets/' . $this->ticket->ticket_num,
|
|
]);
|
|
}
|
|
}
|