Track HiveGrid Cloud planning reference

This commit is contained in:
david committed 2026-06-26 20:48:01 +02:00
1 parent b3d5ea6764
commit e341c5938a
5784 files changed
+1104929 -3

No files matched your search

@@ -0,0 +1,63 @@
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 (
<TransactionalScaffold
brand={brand}
subject={resolvedSubject}
previewText={previewText ?? `Click to sign in to ${brand.productName}`}
eyebrow={eyebrow ?? "Magic link"}
title={resolvedTitle}
intro={intro ?? `Click the button below to sign in to your ${brand.productName} account. No password required.`}
actionUrl={actionUrl}
actionLabel={actionLabel ?? "Sign in"}
outro={outro ?? "If you didn't request this email, you can safely ignore it."}
unsubscribeUrl={unsubscribeUrl}
signoffThanks={signoffThanks}
>
<InfoBox brand={brand} tone="warning">
{expiresText ?? `This link expires in ${expiresInMinutes} minutes and can only be used once.`}
</InfoBox>
</TransactionalScaffold>
);
}