<?php

namespace App\Mail\Subscription;

use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;

class SubscriptionCanceled extends BaseSubscriptionMail
{
    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Your subscription has been canceled',
        );
    }

    public function content(): Content
    {
        return new Content(
            markdown: 'mail.subscription.canceled',
            with: array_merge($this->commonData(), [
                'periodEndsAt' => $this->subscription->current_period_ends_at,
                'cancelsAtPeriodEnd' => (bool) $this->subscription->cancels_at_period_end,
            ]),
        );
    }
}
