Password reset email
A password reset email under a dithered blue header: one button, when the link expires, and the link to paste if the button fails.
|
Logoipsum · 100 Example Street, Springfield |
Options
Code
import { Body, Button, Container, Head, Heading, Hr, Html, Img, Link, Preview, Section, Text } from "@react-email/components";
const font = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif";
const images = "https://designs.here/emails";
const ink = "#171717";
const soft = "#5c5c5c";
const faint = "#8a8a8a";
const mono = "ui-monospace, SFMono-Regular, Menlo, monospace";
const body = { margin: 0, padding: "32px 16px", background: "#ffffff", fontFamily: font };
const card = { width: "100%", maxWidth: 400, border: "1px solid #e3e3e0", borderRadius: 10, overflow: "hidden", background: "#ffffff" };
const title = { margin: "0 0 4px", fontSize: 16, lineHeight: "24px", fontWeight: 500, letterSpacing: "-0.02em", color: ink };
const footer = { margin: "16px 0 0", fontSize: 11, lineHeight: "16px", color: faint, textAlign: "center" };
const small = { fontSize: 12, lineHeight: "18px", color: faint };
/* A password reset: one button, how long the link lasts, the link written out
in case the button fails, and what to do if they did not ask. */
export function ResetEmail({ email = "[email protected]", link = "https://example.com/reset?token=abc123", minutes = 30 }) {
return (
<Html lang="en">
<Head />
<Preview>{"Reset your password. The link expires in " + minutes + " minutes."}</Preview>
<Body style={body}>
<Container style={card}>
<Section style={{ height: 96, background: "#1647d6 url(" + images + "/dither-header.png) center top / 100% 96px no-repeat" }}>
<Img src={images + "/logo-white.png"} width={114} height={20} alt="Logoipsum" style={{ display: "block", margin: "20px 24px 56px" }} />
</Section>
<Section style={{ padding: "12px 24px 24px" }}>
<Heading as="h1" style={title}>Reset your password</Heading>
<Text style={{ margin: "0 0 20px", fontSize: 13, lineHeight: "20px", color: soft }}>
Someone asked to reset the password for <span style={{ color: ink }}>{email}</span>. If that was you, choose a new one below.
</Text>
<Button href={link} style={{ display: "inline-block", padding: "7px 14px", border: "1px solid #1647d6", borderRadius: 7, background: "#2563ff", color: "#ffffff", fontSize: 13, lineHeight: "18px", fontWeight: 500, letterSpacing: "-0.01em", textDecoration: "none" }}>
Choose a new password
</Button>
<Text style={{ margin: "20px 0 0", padding: "10px 14px", borderRadius: 7, background: "#fdf6e7", fontSize: 12, lineHeight: "18px", color: "#7a5200" }}>
The link works once and expires in {minutes} minutes.
</Text>
<Hr style={{ margin: "22px 0 18px", border: 0, borderTop: "1px solid #e3e3e0" }} />
<Text style={{ ...small, margin: "0 0 12px" }}>
Button not working? Paste this link into your browser:
<br />
<Link href={link} style={{ color: ink, textDecoration: "none", wordBreak: "break-all" }}>{link}</Link>
</Text>
<Text style={{ ...small, margin: 0 }}>Did not ask for this? Ignore this email and your password stays as it is.</Text>
</Section>
</Container>
<Text style={{ ...footer, fontFamily: mono }}>Logoipsum · 100 Example Street, Springfield</Text>
</Body>
</Html>
);
}
export default ResetEmail;<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="color-scheme" content="light" />
<title>Reset your password</title>
</head>
<body style="margin:0;padding:0;background:#ffffff;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#ffffff;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;">
<tr>
<td align="center" style="padding:32px 16px;">
<table role="presentation" width="400" cellpadding="0" cellspacing="0" style="width:100%;max-width:400px;border:1px solid #e3e3e0;border-radius:10px;overflow:hidden;background:#ffffff;">
<tr>
<td height="96" valign="top" bgcolor="#1647d6" background="https://designs.here/emails/dither-header.png" style="height:76px;padding:20px 24px 0;background:#1647d6 url(https://designs.here/emails/dither-header.png) center top / 100% 96px no-repeat;"><img src="https://designs.here/emails/logo-white.png" width="114" height="20" alt="Logoipsum" style="display:block;border:0;" /></td>
</tr>
<tr>
<td style="padding:12px 24px 24px;">
<h1 style="margin:0 0 4px;font-size:16px;line-height:24px;font-weight:500;letter-spacing:-0.02em;color:#171717;">Reset your password</h1>
<p style="margin:0 0 20px;font-size:13px;line-height:20px;color:#5c5c5c;">Someone asked to reset the password for <span style="color:#171717;">[email protected]</span>. If that was you, choose a new one below.</p>
<a href="https://example.com/reset?token=abc123" style="display:inline-block;padding:7px 14px;border:1px solid #1647d6;border-radius:7px;background:#2563ff;color:#ffffff;font-size:13px;line-height:18px;font-weight:500;letter-spacing:-0.01em;text-decoration:none;">Choose a new password</a>
<p style="margin:20px 0 0;padding:10px 14px;border-radius:7px;background:#fdf6e7;font-size:12px;line-height:18px;color:#7a5200;">The link works once and expires in 30 minutes.</p>
<div style="margin:22px 0 18px;border-top:1px solid #e3e3e0;font-size:0;line-height:0;"> </div>
<p style="margin:0 0 12px;font-size:12px;line-height:18px;color:#8a8a8a;">Button not working? Paste this link into your browser:<br /><a href="https://example.com/reset?token=abc123" style="color:#171717;text-decoration:none;word-break:break-all;">https://example.com/reset?token=abc123</a></p>
<p style="margin:0;font-size:12px;line-height:18px;color:#8a8a8a;">Did not ask for this? Ignore this email and your password stays as it is.</p>
</td>
</tr>
</table>
<p style="margin:16px 0 0;font-size:11px;line-height:16px;color:#8a8a8a;font-family:ui-monospace, SFMono-Regular, Menlo, monospace;">Logoipsum · 100 Example Street, Springfield</p>
</td>
</tr>
</table>
</body>
</html>Password reset email is not in the Figma file yet.
Use the React or HTML code for now.