<?php

namespace App\Mail;

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

class WelcomeSubscriberMail extends Mailable
{
    use Queueable, SerializesModels;

    public SubscriberModel $subscriber;

    public function __construct(SubscriberModel $subscriber)
    {
        $this->subscriber = $subscriber;
    }

    public function build()
    {
        return $this
            ->subject('Welcome to Our Newsletter 🎉')
            ->view('emails.welcome_subscriber', [
                'subscriber' => $this->subscriber
            ]);
    }
}
