<?php

namespace App\Notifications;

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

class EditRequest extends Notification// implements ShouldQueue
{
    use Queueable;

    private $link;
    private $admin_name;
    private $payment_id;
    private $reason;
    private $current_user;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($link, $admin_name, $payment_id, $reason, $current_user)
    {
        //
        $this->link = $link;
        $this->admin_name = $admin_name; 
        $this->payment_id = $payment_id;
        $this->reason = $reason;
        $this->current_user = $current_user;
    }

    /**
     * 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)
    {
        return (new MailMessage)
        ->subject('A request to delete - Payment #' . $this->payment_id)
        ->line('A new request to delete a payment has been sent by '. $this->current_user .'. The reason is: ' . $this->reason . '.')
        ->action('Click here to view it', $this->link)
        ->line('Thank you for using our application!');
    }

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