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

Reset your password

Someone asked to reset the password for [email protected]. If that was you, choose a new one below.

Choose a new password

The link works once and expires in 30 minutes.

 

Button not working? Paste this link into your browser:
https://example.com/reset?token=abc123

Did not ask for this? Ignore this email and your password stays as it is.

Logoipsum · 100 Example Street, Springfield

Options

Screen

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;
Logoipsum

Reset your password

Someone asked to reset the password for [email protected]. If that was you, choose a new one below.

Choose a new password

The link works once and expires in 30 minutes.

 

Button not working? Paste this link into your browser:
https://example.com/reset?token=abc123

Did not ask for this? Ignore this email and your password stays as it is.

Logoipsum · 100 Example Street, Springfield