import { Heading } from '@react-email/heading'; import { Text } from '@react-email/text'; import { EmailContainer } from '../components/EmailContainer'; import type { EmailBaseProps } from '../types'; export type SecondFactorResetEmailTemplateProps = { mode: EmailBaseProps['mode']; tenant: EmailBaseProps['tenant']; audience: 'admin' | 'user'; user: string; initiator: 'support' | 'teamAdmin'; approvedBy: string | null; resetAt: string; }; export const SecondFactorResetEmailTemplate = ({ mode, tenant, audience, user, initiator, approvedBy, resetAt, }: SecondFactorResetEmailTemplateProps) => { const by = initiator === 'support' ? `VRPlatform support${approvedBy ? `, approved by ${approvedBy}` : ''}` : (approvedBy ?? 'a team admin'); return ( {audience === 'admin' ? `Two-step verification reset for ${user}` : 'Your two-step verification was reset'} {audience === 'admin' ? ( <> The authenticator app and the backup codes of {user} were removed on {resetAt} by {by}. {user} is signed out everywhere and sets up two-step verification again at the next sign-in. If you did not expect this reset, contact VRPlatform support right away. ) : ( <> Your authenticator app and your backup codes for {tenant.name} were removed on {resetAt} by {by}. You are signed out everywhere. Sign in again and set up two-step verification. If you did not ask for this reset, contact VRPlatform support right away. )} ); };