<?php

namespace App\Mail;

use App\Models\Plan;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class GiftAccessMail extends Mailable
{
    use Queueable, SerializesModels;

    public $mailer = 'system';

    public function __construct(
        public User    $user,
        public Plan    $plan,
        public string  $durationLabel,
        public ?Carbon $endsAt,
    ) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Du hast kostenlosen Zugang zu Aziros erhalten!',
        );
    }

    public function content(): Content
    {
        return new Content(
            view: 'emails.gift-access',
        );
    }
}
