<?php

declare(strict_types=1);

require_once __DIR__ . '/layout.php';

function iav_verify_email(string $displayName, string $verificationUrl, int $expiresMinutes = 60): string
{
    $safeName = htmlspecialchars($displayName, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
    $minutes = max(1, $expiresMinutes);
    $body = "<p>Hello {$safeName},</p><p>Verify your email address to protect your account. This secure link expires in {$minutes} minutes.</p><p>If you did not create this account, you can ignore this email.</p>";

    return iav_mail_layout('Verify your email address', $body, 'Verify email', $verificationUrl);
}
