<?php
namespace Portal\Mileage\Handlers\Events;

use Portal\Mileage\Events\NotifyEmail;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

// use Threef\Entree\Database\Model\User;
// use Elesen\Model\Data\Model\Application\Applicant;
use Portal\Mileage\Http\Notifications\PpjMailer;

class SentEmail
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  PaymentMade  $event
     * @return void
     */
    public function handle(NotifyEmail $event)
    {
        $application = $event->application;
        $message = $event->messageContent;

        // dd($message);

        $user = User::find(id);
        // $applicant = Applicant::find($application->fk_applicant);

        // if(filter_var($user->email, FILTER_VALIDATE_EMAIL)) :

        //     $user->notify(new PpjMailer($message));

        // endif;

        // if(filter_var($applicant->emel, FILTER_VALIDATE_EMAIL)) :

        //     if($user->email != $applicant->emel):
        //         $applicant->notify(new PpjMailer($message));
        //     endif;

        // endif;

    }
}
