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

74 lines
2 KiB
TypeScript
Raw Normal View History

2024-12-15 17:47:07 -05:00
import {
Body,
Head,
Html,
Preview,
Tailwind
} from "@react-email/components";
import * as React from "react";
2025-01-04 20:22:01 -05:00
import {
EmailContainer,
EmailLetterHead,
EmailHeading,
EmailText,
EmailFooter,
EmailSection,
2025-01-05 00:06:24 -05:00
EmailGreeting,
EmailSignature
2025-01-04 20:22:01 -05:00
} from "./components/Email";
import { themeColors } from "./lib/theme";
import CopyCodeBox from "./components/CopyCodeBox";
2024-12-15 17:47:07 -05:00
interface ResourceOTPCodeProps {
email?: string;
resourceName: string;
orgName: string;
otp: string;
}
export const ResourceOTPCode = ({
email,
resourceName,
orgName: organizationName,
otp
}: ResourceOTPCodeProps) => {
const previewText = `Your one-time password for ${resourceName} is ${otp}`;
2024-12-15 17:47:07 -05:00
return (
<Html>
<Head />
<Preview>{previewText}</Preview>
2025-01-04 20:22:01 -05:00
<Tailwind config={themeColors}>
2024-12-15 17:47:07 -05:00
<Body className="font-sans">
2025-01-04 20:22:01 -05:00
<EmailContainer>
<EmailLetterHead />
2025-01-04 20:22:01 -05:00
<EmailHeading>
2025-01-29 11:14:10 -05:00
Your One-Time Code for {resourceName}
2025-01-04 20:22:01 -05:00
</EmailHeading>
<EmailGreeting>Hi {email || "there"},</EmailGreeting>
<EmailText>
Youve requested a one-time password to access{" "}
2024-12-15 17:47:07 -05:00
<strong>{resourceName}</strong> in{" "}
<strong>{organizationName}</strong>. Use the code
2024-12-15 17:47:07 -05:00
below to complete your authentication:
2025-01-04 20:22:01 -05:00
</EmailText>
<EmailSection>
<CopyCodeBox text={otp} />
</EmailSection>
<EmailFooter>
2025-01-05 00:06:24 -05:00
<EmailSignature />
2025-01-04 20:22:01 -05:00
</EmailFooter>
</EmailContainer>
2024-12-15 17:47:07 -05:00
</Body>
</Tailwind>
</Html>
);
};
export default ResourceOTPCode;