<?php

namespace App\Mail;

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

class TodoInviteMail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(public User $user) {}

    public function build()
    {
        $link = route('todo.activate.show', $this->user->activation_token);
        return $this->subject('You’re invited to To-Do Workspace')
            ->markdown('emails.todo.invite', ['user' => $this->user, 'link' => $link]);
    }
}
