<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use App\Models\Subscription;

class SubscriptionExpiring extends Mailable
{
    use Queueable, SerializesModels;

    public $subscription;
    public $daysLeft;

    public function __construct(Subscription $subscription, $daysLeft)
    {
        $this->subscription = $subscription;
        $this->daysLeft = $daysLeft;
    }

    public function build()
    {
        return $this->subject("Your Subscription Expires in {$this->daysLeft} Days")
                    ->view('emails.subscription.expiring');
    }
}
