<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

class RequestState extends Notification
{
    use Queueable;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($name,$approval,$ss,$denial)
    {
        $this->name = $name;
        $this->approval = $approval;
        $this->denial   = $denial;
        $this->p_code = $ss;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        $url = url('/login');

        return (new MailMessage)
                    ->subject('Kwik Ad Notifier')
                    ->markdown('notify',[$this->name,$this->approval,$this->p_code,$this->denial]);
//                    ->line($this->name )
//                    ->line($this->approval .' '.$this->p_code)
//                    ->line($this->denial)
//                    ->action('view', $url)
//                    ->line('Thank you for using our application!');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}
