import { TransactionalScaffold } from "./shared.js"; import { InfoBox } from "../_layout/InfoBox.js"; import type { MailBrand } from "../_layout/theme.js"; /** * MagicLink email — passwordless sign-in flow. * Includes a short expiry-warning InfoBox plus the standard CTA. */ export interface MagicLinkEmailProps { readonly brand: MailBrand; readonly recipientName?: string; readonly actionUrl: string; readonly expiresInMinutes?: number; readonly subject?: string; readonly previewText?: string; readonly eyebrow?: string; readonly title?: string; readonly intro?: string; readonly actionLabel?: string; readonly outro?: string; readonly expiresText?: string; readonly unsubscribeUrl?: string; readonly signoffThanks?: string; } export function MagicLinkEmail({ brand, recipientName, actionUrl, expiresInMinutes = 15, subject, previewText, eyebrow, title, intro, actionLabel, outro, expiresText, unsubscribeUrl, signoffThanks, }: MagicLinkEmailProps) { const resolvedSubject = subject ?? `Your sign-in link for ${brand.productName}`; const resolvedTitle = title ?? (recipientName ? `Hello, ${recipientName}!` : "Hello!"); return ( {expiresText ?? `This link expires in ${expiresInMinutes} minutes and can only be used once.`} ); }