feat: Add deposit success email notification system with new mailer, job, view, and client update request.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Mail\Customer;
|
||||
|
||||
use App\Mail\Customer\DepositSuccess;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class DepositSuccessJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public array $data;
|
||||
|
||||
public function __construct(array $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
try {
|
||||
Mail::to($this->data['customer_email'])
|
||||
->send(new DepositSuccess($this->data));
|
||||
} catch (\Throwable $e) {
|
||||
\Log::error('Không thể gửi email thông báo nạp tiền thành công: ' . $e->getMessage(), [
|
||||
'customer_email' => $this->data['customer_email'] ?? null,
|
||||
'transaction_code' => $this->data['transaction_code'] ?? null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user