Files
portal-api/app/Mail/Customer/DepositSuccess.php
2026-10-05 09:30:24 +07:00

40 lines
1.3 KiB
PHP

<?php
namespace App\Mail\Customer;
use App\Mail\TemplateMailable;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
class DepositSuccess extends TemplateMailable
{
use Queueable, SerializesModels;
public array $data;
public function __construct(array $data)
{
$this->data = $data;
}
protected function scenario(): string
{
return 'customer_deposit_success';
}
protected function variables(): array
{
return [
'customer_name' => $this->data['customer_name'] ?? 'Khách hàng',
'transaction_code' => $this->data['transaction_code'] ?? 'N/A',
'amount_formatted' => number_format((float) ($this->data['amount'] ?? 0)),
'credit_formatted' => number_format((float) ($this->data['credit'] ?? 0)),
'current_total_formatted' => number_format((float) ($this->data['current_total'] ?? 0)),
'current_credit_formatted' => number_format((float) ($this->data['current_credit'] ?? 0)),
'deposit_date' => $this->data['deposit_date'] ?? now()->format('d/m/Y H:i:s'),
'support_email' => config('mail.support_email', 'support@thegioiso.com'),
'support_phone' => config('mail.support_phone', '1900.xxxx'),
];
}
}