Skip to content
Launch offerSolo $19 $49 · Team $39 $79Launch pricing ends Sunday
Mailblocks

Password reset email

Password reset with expiry, request details and a clear didn't-request-this path.

13.2 KB · Gmail-safe

Code

import * as React from "react";
import { Btn, Divider, Eyebrow, Fallback, H1, KV, P, Shell, Small, type TemplateProps } from "../components";

export type PasswordResetProps = TemplateProps & {
  firstName?: string;
  resetUrl?: string;
  expiresInMinutes?: number;
  device?: string;
  location?: string;
};

export default function PasswordReset({
  style,
  brand,
  firstName = "Maya",
  resetUrl = "https://fieldnote.app/reset-password?token=c41e9b77a0",
  expiresInMinutes = 60,
  device = "Chrome on macOS",
  location = "Lisbon, Portugal",
}: PasswordResetProps) {
  return (
    <Shell style={style} brand={brand} label="Security" preview={`Use this link within ${expiresInMinutes} minutes to choose a new password.`}>
      <Eyebrow>Password reset</Eyebrow>
      <H1>Reset your password</H1>
      <P>Hi {firstName}, we received a request to reset the password for your account. Choose a new one below.</P>
      <Btn href={resetUrl}>Choose a new password</Btn>
      <Small>For your security this link expires in {expiresInMinutes} minutes and works once.</Small>
      <KV
        rows={[
          ["Requested from", device],
          ["Approximate location", location],
        ]}
      />
      <P>
        <strong>Didn't ask for this?</strong> Ignore this email — your password won't change. If you keep getting these,
        reply and we'll look into it.
      </P>
      <Divider my={16} />
      <Fallback href={resetUrl} />
    </Shell>
  );
}

PasswordReset.PreviewProps = {} satisfies PasswordResetProps;

The TSX imports components.tsx and theme.ts from the kit. Grab the free starter (all six free templates with their components) on the free page.