<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class ExpirySoonEmail extends Notification
{
    use Queueable;

    protected $name;
    protected $subscriptionName;
    public function __construct($name, $subscriptionName)
    {
        $this->name = $name;
        $this->subscriptionName = $subscriptionName;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @return array<int, string>
     */
    public function via(object $notifiable): array
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     */
    public function toMail(object $notifiable): MailMessage
    {
        return (new MailMessage)
            ->subject('Subscription Reminder')
            ->view('auth.email.expiry-soon', [
                'name' => $this->name,
                'subscriptionName' => $this->subscriptionName,
            ]);
    }

    /**
     * Get the array representation of the notification.
     *
     * @return array<string, mixed>
     */
    public function toArray(object $notifiable): array
    {
        return [
            //
        ];
    }
}
