anydrop/server/src/mail/templates.ts
ordinarthur 2913618ee6
Some checks failed
Build & Deploy / build-and-deploy (push) Failing after 1m47s
feat: stealth accounts + data layer (Phase 1)
2026-04-20 09:57:22 +02:00

36 lines
1.6 KiB
TypeScript

export function magicLinkEmail(verifyUrl: string): { subject: string; text: string; html: string } {
const subject = "Your AnyDrop sign-in link";
const text = `Hi,
Click the link below to sign in to AnyDrop. It expires in 15 minutes and can only be used once.
${verifyUrl}
If you didn't request this, you can safely ignore this email.
— AnyDrop
`;
const html = `<!doctype html>
<html lang="en">
<body style="margin:0;padding:32px;background:#0f172a;color:#e2e8f0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;">
<table role="presentation" style="max-width:480px;margin:0 auto;background:#1e293b;border-radius:16px;padding:32px;">
<tr><td>
<h1 style="margin:0 0 16px;font-size:22px;color:#f8fafc;">Sign in to AnyDrop</h1>
<p style="margin:0 0 24px;line-height:1.5;color:#cbd5e1;">Click the button below to sign in. The link expires in 15 minutes and can only be used once.</p>
<p style="margin:0 0 24px;">
<a href="${verifyUrl}" style="display:inline-block;background:#6366f1;color:#fff;text-decoration:none;padding:12px 20px;border-radius:10px;font-weight:600;">Sign in</a>
</p>
<p style="margin:0 0 8px;color:#94a3b8;font-size:13px;">Or copy this link into your browser:</p>
<p style="margin:0;word-break:break-all;color:#64748b;font-size:13px;">${verifyUrl}</p>
<hr style="border:none;border-top:1px solid #334155;margin:24px 0;">
<p style="margin:0;color:#64748b;font-size:12px;">If you didn't request this, you can safely ignore this email.</p>
</td></tr>
</table>
</body>
</html>`;
return { subject, text, html };
}