feat: Add deposit success email notification system with new mailer, job, view, and client update request.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\Customer;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class DepositSuccess extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public array $data;
|
||||
|
||||
public function __construct(array $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: '✅ Nạp tiền thành công - ' . number_format($this->data['amount']) . ' VNĐ',
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'emails.customer.deposit-success',
|
||||
with: [
|
||||
'customerName' => $this->data['customer_name'] ?? 'Khách hàng',
|
||||
'transactionCode' => $this->data['transaction_code'] ?? 'N/A',
|
||||
'amount' => $this->data['amount'] ?? 0,
|
||||
'amountFormatted' => number_format($this->data['amount']) ?? '0',
|
||||
'credit' => $this->data['credit'] ?? 0,
|
||||
'creditFormatted' => number_format($this->data['credit']) ?? '0',
|
||||
'currentTotal' => $this->data['current_total'] ?? 0,
|
||||
'currentTotalFormatted' => number_format($this->data['current_total']) ?? '0',
|
||||
'currentCredit' => $this->data['current_credit'] ?? 0,
|
||||
'currentCreditFormatted' => number_format($this->data['current_credit']) ?? '0',
|
||||
'depositDate' => $this->data['deposit_date'] ?? now()->format('d/m/Y H:i:s'),
|
||||
'supportEmail' => config('mail.support_email', 'support@thegioiso.com'),
|
||||
'supportPhone' => config('mail.support_phone', '1900.xxxx'),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user