<?php

namespace Modules\PortalApi\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class PortalMagicLink extends Mailable
{
    use Queueable, SerializesModels;

    public string $ownerName;
    public string $clinicName;
    public string $magicUrl;
    public int    $minutes;

    public function __construct(string $ownerName, string $clinicName, string $magicUrl, int $minutes)
    {
        $this->ownerName  = $ownerName;
        $this->clinicName = $clinicName;
        $this->magicUrl   = $magicUrl;
        $this->minutes    = $minutes;
    }

    public function build()
    {
        return $this
            ->subject('Your sign-in link · ' . $this->clinicName)
            ->view('portalApi::emails.magic_link');
    }
}
