fosrl.pangolin/server/emails/templates/ResetPasswordCode.tsx

70 lines
2.2 KiB
TypeScript
Raw Normal View History

2025-07-13 21:57:24 -07:00
import React from "react";
import { Body, Head, Html, Preview, Tailwind } from "@react-email/components";
2025-01-04 20:22:01 -05:00
import { themeColors } from "./lib/theme";
import {
EmailContainer,
EmailFooter,
EmailGreeting,
EmailHeading,
EmailLetterHead,
EmailSection,
2025-01-05 00:06:24 -05:00
EmailSignature,
2025-01-04 20:22:01 -05:00
EmailText
} from "./components/Email";
import CopyCodeBox from "./components/CopyCodeBox";
2025-07-13 21:57:24 -07:00
import ButtonLink from "./components/ButtonLink";
2024-12-22 16:59:30 -05:00
interface Props {
email: string;
code: string;
link: string;
}
export const ResetPasswordCode = ({ email, code, link }: Props) => {
2025-07-13 21:57:24 -07:00
const previewText = `Reset your password with code: ${code}`;
2024-12-22 16:59:30 -05:00
return (
<Html>
<Head />
<Preview>{previewText}</Preview>
2025-01-04 20:22:01 -05:00
<Tailwind config={themeColors}>
2025-07-13 21:57:24 -07:00
<Body className="font-sans bg-gray-50">
2025-01-04 20:22:01 -05:00
<EmailContainer>
<EmailLetterHead />
2025-07-13 21:57:24 -07:00
{/* <EmailHeading>Reset Your Password</EmailHeading> */}
2025-01-04 20:22:01 -05:00
2025-07-13 21:57:24 -07:00
<EmailGreeting>Hi there,</EmailGreeting>
2025-01-04 20:22:01 -05:00
<EmailText>
2025-07-13 21:57:24 -07:00
You've requested to reset your password. Click the
button below to reset your password, or use the
verification code provided if prompted.
2025-01-04 20:22:01 -05:00
</EmailText>
2025-07-13 21:57:24 -07:00
<EmailSection>
<ButtonLink href={link}>Reset Password</ButtonLink>
</EmailSection>
2025-01-04 20:22:01 -05:00
<EmailSection>
<CopyCodeBox text={code} />
</EmailSection>
<EmailText>
2025-07-13 21:57:24 -07:00
This reset code will expire in 2 hours. If you
didn't request a password reset, you can safely
ignore this email.
2025-01-04 20:22:01 -05:00
</EmailText>
<EmailFooter>
2025-01-05 00:06:24 -05:00
<EmailSignature />
2025-01-04 20:22:01 -05:00
</EmailFooter>
</EmailContainer>
2024-12-22 16:59:30 -05:00
</Body>
</Tailwind>
</Html>
);
};
export default ResetPasswordCode;