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

77 lines
2.6 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,
2025-01-05 00:06:24 -05:00
EmailSignature,
2025-01-04 20:22:01 -05:00
EmailText
} from "./components/Email";
interface Props {
email: string;
enabled: boolean;
}
export const TwoFactorAuthNotification = ({ email, enabled }: Props) => {
2025-07-13 21:57:24 -07:00
const previewText = `Two-Factor Authentication ${enabled ? "enabled" : "disabled"} for your account`;
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> */}
{/* Security Update: 2FA{" "} */}
{/* {enabled ? "Enabled" : "Disabled"} */}
{/* </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
Two-factor authentication has been successfully{" "}
<strong>{enabled ? "enabled" : "disabled"}</strong>{" "}
on your account.
2025-01-04 20:22:01 -05:00
</EmailText>
{enabled ? (
2025-07-13 21:57:24 -07:00
<>
<EmailText>
Your account is now protected with an
additional layer of security. Keep your
authentication method safe and accessible.
</EmailText>
</>
) : (
2025-07-13 21:57:24 -07:00
<>
<EmailText>
We recommend re-enabling two-factor
authentication to keep your account secure.
</EmailText>
</>
)}
2025-01-04 20:22:01 -05:00
2025-07-13 21:57:24 -07:00
<EmailText>
If you didn't make this change, please contact our
support team immediately.
</EmailText>
2025-01-04 20:22:01 -05:00
<EmailFooter>
2025-01-05 00:06:24 -05:00
<EmailSignature />
2025-01-04 20:22:01 -05:00
</EmailFooter>
</EmailContainer>
</Body>
</Tailwind>
</Html>
);
};
export default TwoFactorAuthNotification;