<?php

namespace App\Listeners;

use App\Events\PaymentCanceled;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Mail;
use Modules\Paypal\app\Emails\PaymentCanceledMail;

class SendMailPaymentCanceled
{
    /**
     * Create the event listener.
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     */
    public function handle(PaymentCanceled $event): void
    {
        Mail::send(
            new PaymentCanceledMail(
                payment_id: $event->payment_id,
                email: $event->email,
                name: $event->name,
            )
        );
    }
}
