48 lines
1.6 KiB
PHP
48 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Mail\Customer;
|
|
|
|
use App\Mail\TemplateMailable;
|
|
use App\Support\EmailTemplateShell;
|
|
use App\Support\MailGlobals;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class ManualDepositStatus extends TemplateMailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public function __construct(public array $data) {}
|
|
|
|
public function attachments(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
protected function scenario(): string
|
|
{
|
|
return 'manual_deposit_status';
|
|
}
|
|
|
|
protected function variables(): array
|
|
{
|
|
$data = [...MailGlobals::values(), ...$this->data];
|
|
$amount = (float) ($data['amount'] ?? 0);
|
|
|
|
return [
|
|
'customer_name' => $data['customer_name'] ?? 'Quý khách',
|
|
'transaction_code' => $data['transaction_code'] ?? 'N/A',
|
|
'amount_formatted' => number_format($amount, 0, ',', '.'),
|
|
'status_label' => $data['status_label'] ?? 'Đang chờ duyệt',
|
|
'status_color' => $data['status_color'] ?? '#f16723',
|
|
'status_bg' => $data['status_bg'] ?? '#fff7ed',
|
|
'status_message' => $data['status_message'] ?? ($data['message'] ?? ''),
|
|
'deposit_date' => $data['deposit_date'] ?? now()->format('d/m/Y H:i:s'),
|
|
'processed_date_row' => !empty($data['processed_date'])
|
|
? EmailTemplateShell::row('Thời gian xử lý', e($data['processed_date']))
|
|
: '',
|
|
'portal_url' => $data['portal_url'] ?? MailGlobals::frontendUrl() . '/nap-tien',
|
|
];
|
|
}
|
|
}
|