feat: Add deposit success email notification system with new mailer, job, view, and client update request.
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Enums\TransactionStatus;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\DepositRequest;
|
||||
use App\Http\Services\VNPayService;
|
||||
use App\Jobs\Mail\Customer\DepositSuccessJob;
|
||||
use App\Models\Customer;
|
||||
use App\Models\Log;
|
||||
use App\Models\Transaction;
|
||||
@@ -148,6 +149,17 @@ class TransactionController extends Controller
|
||||
'customer_id' => $transaction->customer_id,
|
||||
]);
|
||||
|
||||
DepositSuccessJob::dispatch([
|
||||
'customer_email' => $customer->email,
|
||||
'customer_name' => $customer->fullname,
|
||||
'transaction_code' => $transaction->public_code,
|
||||
'amount' => $transaction->amount,
|
||||
'credit' => $transaction->amount / 100,
|
||||
'current_total' => $customer->total,
|
||||
'current_credit' => $customer->credit,
|
||||
'deposit_date' => now()->format('d/m/Y H:i:s'),
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
|
||||
Reference in New Issue
Block a user