<?php

namespace App\Listeners\Feedback;

use App\Events\Feedback\FeedbackFormSubmitted;
use App\Mail\Feedback\NotifyFeedbackFormSubmitted;
use Illuminate\Support\Facades\Mail;

class SendFeedbackFormNotifications {
    public function __construct() {
    }

    public function handle(FeedbackFormSubmitted $event) {
        try {
            Mail::to($event->mailto)->send(new NotifyFeedbackFormSubmitted($event->object));
        } catch (\Exception $exception) {
            var_dump($exception);
        }
    }
}
