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

74 lines
2.4 KiB
TypeScript
Raw Normal View History

2024-10-03 20:55:54 -04:00
import {
Body,
Container,
Head,
Heading,
Html,
Preview,
Section,
Text,
Tailwind,
} from "@react-email/components";
import * as React from "react";
interface VerifyEmailProps {
username?: string;
verificationCode: string;
2024-11-28 00:11:13 -05:00
verifyLink: string;
2024-10-03 20:55:54 -04:00
}
export const VerifyEmail = ({
username,
verificationCode,
2024-11-28 00:11:13 -05:00
verifyLink,
2024-10-03 20:55:54 -04:00
}: VerifyEmailProps) => {
const previewText = `Verify your email, ${username}`;
return (
<Html>
<Head />
<Preview>{previewText}</Preview>
2024-11-28 00:11:13 -05:00
<Tailwind
config={{
theme: {
extend: {
colors: {
primary: "#F97317",
},
},
},
}}
>
2024-10-03 20:55:54 -04:00
<Body className="font-sans">
2024-11-28 00:11:13 -05:00
<Container className="bg-white border border-solid border-gray-200 p-6 max-w-lg mx-auto my-8 rounded-lg">
2024-10-03 20:55:54 -04:00
<Heading className="text-2xl font-semibold text-gray-800 text-center">
2024-11-28 00:11:13 -05:00
Please verify your email
2024-10-03 20:55:54 -04:00
</Heading>
<Text className="text-base text-gray-700 mt-4">
Hi {username || "there"},
</Text>
<Text className="text-base text-gray-700 mt-2">
2024-11-28 00:11:13 -05:00
Youve requested to verify your email. Please{" "}
<a href={verifyLink} className="text-primary">
click here
</a>{" "}
to verify your email, then enter the following code:
2024-10-03 20:55:54 -04:00
</Text>
<Section className="text-center my-6">
2024-11-28 00:11:13 -05:00
<Text className="inline-block bg-primary text-xl font-bold text-white py-2 px-4 border border-gray-300 rounded-xl">
2024-10-03 20:55:54 -04:00
{verificationCode}
</Text>
</Section>
<Text className="text-base text-gray-700 mt-2">
If you didnt request this, you can safely ignore
this email.
</Text>
</Container>
</Body>
</Tailwind>
</Html>
);
};
2024-11-28 00:11:13 -05:00
export default VerifyEmail;