<?php

namespace App\Notifications;

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

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

    private $link;
    private $member_name;
    private $receipt_num;

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

    /**
     * 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('New Payment received - Reciept #' . $this->receipt_num)
        ->line('A new receipt has been generated.')
        ->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 [
            //
        ];
    }
}
