import { ReactNode } from 'react'; /** * Shared logo URL shape used across Athena Auth email templates. * A single string, or light/dark variants for dual-theme emails. */ export type EmailLogoURL = string | { dark: string; light: string; }; /** * Custom CSS class names for styling different parts of email templates. */ export interface EmailClassNames { body?: string; button?: string; card?: string; codeBlock?: string; container?: string; content?: string; description?: string; link?: string; logo?: string; poweredBy?: string; separator?: string; title?: string; } /** * Email color token set for a single theme mode. */ export interface EmailColorTokens { background: string; border: string; card: string; cardForeground: string; foreground: string; muted: string; mutedForeground: string; primary: string; primaryForeground: string; } /** * Custom color scheme configuration for email templates. * * Supports separate color definitions for light and dark modes. * Any color not specified falls back to the underlying template defaults. */ export interface EmailColors { dark?: Partial; light?: Partial; } /** * Common props shared by every Athena Auth email template. */ export interface EmailTemplateBaseProps { /** Name of the application sending the email */ appName?: string; /** Custom CSS class names for styling specific parts of the email */ classNames?: EmailClassNames; /** Custom color scheme for light and dark modes */ colors?: EmailColors; /** Whether to enable dark mode support */ darkMode?: boolean; /** Additional React nodes to inject into the email head */ head?: ReactNode; /** Logo URL(s). If omitted, no logo is shown. */ logoURL?: EmailLogoURL; /** Whether to show the powered-by footer */ poweredBy?: boolean; } /** * Localization strings for the EmailChangedEmail component. */ export interface EmailChangedEmailLocalization { EMAIL_ADDRESS_CHANGED: string; EMAIL_ADDRESS_FOR_YOUR_ACCOUNT_CHANGED: string; EMAIL_SENT_BY: string; I_DIDNT_MAKE_THIS_CHANGE: string; IF_YOU_DIDNT_AUTHORIZE_THIS_CHANGE: string; IF_YOU_MADE_THIS_CHANGE: string; LOGO: string; NEW_EMAIL: string; POWERED_BY_BETTER_AUTH: string; PREVIOUS_EMAIL: string; YOUR_EMAIL_ADDRESS_HAS_BEEN_CHANGED: string; } /** * Props for the EmailChangedEmail component. */ export interface EmailChangedEmailProps extends EmailTemplateBaseProps { /** * Localization overrides for customizing email text * @remarks `EmailChangedEmailLocalization` */ localization?: Partial; /** The new email address */ newEmail?: string; /** The previous email address that was changed */ oldEmail?: string; /** URL to revert the email change if unauthorized */ revertURL?: string; /** Support email address for security concerns */ supportEmail?: string; } /** * Localization strings for the EmailVerificationEmail component. */ export interface EmailVerificationEmailLocalization { CLICK_BUTTON_TO_VERIFY_EMAIL: string; EMAIL_SENT_BY: string; IF_YOU_DIDNT_REQUEST_THIS_EMAIL: string; LOGO: string; OR_COPY_AND_PASTE_URL: string; POWERED_BY_BETTER_AUTH: string; THIS_LINK_EXPIRES_IN_MINUTES: string; VERIFY_EMAIL_ADDRESS: string; VERIFY_YOUR_EMAIL_ADDRESS: string; } /** * Props for the EmailVerificationEmail component. */ export interface EmailVerificationEmailProps extends EmailTemplateBaseProps { /** Email address being verified */ email?: string; /** Number of minutes until the verification link expires */ expirationMinutes?: number; /** * Localization overrides for customizing email text * @remarks `EmailVerificationEmailLocalization` */ localization?: Partial; /** Verification URL that users must click to verify their email */ url: string; } /** * Localization strings for the MagicLinkEmail component. */ export interface MagicLinkEmailLocalization { CLICK_BUTTON_TO_SIGN_IN: string; EMAIL_SENT_BY: string; IF_YOU_DIDNT_REQUEST_THIS_EMAIL: string; LOGO: string; OR_COPY_AND_PASTE_URL: string; POWERED_BY_BETTER_AUTH: string; SIGN_IN_TO_APP_NAME: string; SIGN_IN_TO_YOUR_ACCOUNT: string; THIS_LINK_EXPIRES_IN_MINUTES: string; YOUR_ACCOUNT: string; } /** * Props for the MagicLinkEmail component. */ export interface MagicLinkEmailProps extends EmailTemplateBaseProps { /** Email address of the user signing in */ email?: string; /** Number of minutes until the magic link expires */ expirationMinutes?: number; /** * Localization overrides for customizing email text * @remarks `MagicLinkEmailLocalization` */ localization?: Partial; /** Magic link URL for passwordless authentication */ url: string; } /** * Device information displayed in the new device email notification. */ export interface DeviceInfo { /** Browser name and version */ browser?: string; /** IP address of the device */ ipAddress?: string; /** Geographic location of the sign-in */ location?: string; /** Operating system name and version */ os?: string; /** Timestamp of the sign-in event */ timestamp?: string; } /** * Localization strings for the NewDeviceEmail component. */ export interface NewDeviceEmailLocalization { BROWSER: string; DEVICE_DETAILS: string; EMAIL_SENT_BY: string; IF_THIS_WAS_YOU: string; IF_YOU_DIDNT_SIGN_IN: string; IP_ADDRESS: string; LOCATION: string; LOGO: string; NEW_SIGN_IN_DETECTED: string; NEW_SIGN_IN_TO_YOUR_ACCOUNT: string; OPERATING_SYSTEM: string; POWERED_BY_BETTER_AUTH: string; SECURE_MY_ACCOUNT: string; TIME: string; } /** * Props for the NewDeviceEmail component. */ export interface NewDeviceEmailProps extends EmailTemplateBaseProps { /** Information about the device that signed in */ deviceInfo?: DeviceInfo; /** * Localization overrides for customizing email text * @remarks `NewDeviceEmailLocalization` */ localization?: Partial; /** URL to secure the account if unauthorized access is suspected */ secureAccountLink?: string; /** Support email address for security concerns */ supportEmail?: string; /** Email address of the user account */ userEmail?: string; } /** * Localization strings for the OrganizationInvitationEmail component. */ export interface OrganizationInvitationEmailLocalization { ACCEPT_INVITATION: string; EMAIL_SENT_BY: string; IF_YOU_DIDNT_EXPECT_THIS_INVITATION: string; INVITED_TO_JOIN_ORGANIZATION: string; LOGO: string; OR_COPY_AND_PASTE_URL: string; ORGANIZATION_LOGO: string; POWERED_BY_BETTER_AUTH: string; THIS_INVITATION_EXPIRES_IN_HOURS: string; VIEW_INVITATION: string; YOU_RE_INVITED: string; YOU_RE_INVITED_TO_ORGANIZATION: string; } /** * Props for the OrganizationInvitationEmail component. */ export interface OrganizationInvitationEmailProps extends EmailTemplateBaseProps { /** Email address of the user being invited */ email?: string; /** Number of hours until the invitation expires */ expirationHours?: number; /** Email address of the person who sent the invitation */ inviterEmail?: string; /** Name of the person who sent the invitation */ inviterName?: string; /** * Localization overrides for customizing email text * @remarks `OrganizationInvitationEmailLocalization` */ localization?: Partial; /** Organization logo URL(s) */ organizationLogoURL?: EmailLogoURL; /** Name of the organization the user is being invited to */ organizationName?: string; /** Role being offered to the invitee (e.g. "member", "admin", "owner") */ role?: string; /** * URL where the invitee can review and accept the invitation. * * @remarks Pass `{baseUrl}/settings/organizations` — this is where pending * organization invitations are listed in the settings UI. */ url: string; } /** * Localization strings for the OtpEmail component. */ export interface OtpEmailLocalization { EMAIL_SENT_BY: string; IF_YOU_DIDNT_REQUEST_THIS_EMAIL: string; LOGO: string; POWERED_BY_BETTER_AUTH: string; THIS_CODE_EXPIRES_IN_MINUTES: string; VERIFY_YOUR_EMAIL: string; WE_NEED_TO_VERIFY_YOUR_EMAIL_ADDRESS: string; YOUR_VERIFICATION_CODE_IS_CODE: string; } /** * Props for the OtpEmail component. */ export interface OtpEmailProps extends EmailTemplateBaseProps { /** Email address being verified */ email?: string; /** Number of minutes until the verification code expires */ expirationMinutes?: number; /** * Localization overrides for customizing email text * @remarks `OtpEmailLocalization` */ localization?: Partial; /** The one-time verification code to display */ verificationCode: string; } /** * Localization strings for the PasswordChangedEmail component. */ export interface PasswordChangedEmailLocalization { CHANGED_AT: string; EMAIL_SENT_BY: string; I_DIDNT_MAKE_THIS_CHANGE: string; IF_YOU_DIDNT_AUTHORIZE_THIS_CHANGE: string; IF_YOU_MADE_THIS_CHANGE: string; LOGO: string; PASSWORD_CHANGED_SUCCESSFULLY: string; PASSWORD_FOR_YOUR_ACCOUNT_CHANGED: string; POWERED_BY_BETTER_AUTH: string; YOUR_PASSWORD_HAS_BEEN_CHANGED: string; } /** * Props for the PasswordChangedEmail component. */ export interface PasswordChangedEmailProps extends EmailTemplateBaseProps { /** Email address of the user account */ email?: string; /** * Localization overrides for customizing email text * @remarks `PasswordChangedEmailLocalization` */ localization?: Partial; /** URL to secure the account if unauthorized change occurred */ secureAccountURL?: string; /** Support email address for security concerns */ supportEmail?: string; /** Timestamp when the password was changed */ timestamp?: string; } /** * Localization strings for the ResetPasswordEmail component. */ export interface ResetPasswordEmailLocalization { EMAIL_SENT_BY: string; IF_YOU_DIDNT_REQUEST_PASSWORD_RESET: string; LOGO: string; OR_COPY_AND_PASTE_URL: string; POWERED_BY_BETTER_AUTH: string; RESET_PASSWORD: string; RESET_YOUR_PASSWORD: string; THIS_LINK_EXPIRES_IN_MINUTES: string; WE_RECEIVED_REQUEST_TO_RESET_PASSWORD: string; } /** * Props for the ResetPasswordEmail component. */ export interface ResetPasswordEmailProps extends EmailTemplateBaseProps { /** Email address of the user requesting password reset */ email?: string; /** Number of minutes until the reset link expires */ expirationMinutes?: number; /** * Localization overrides for customizing email text * @remarks `ResetPasswordEmailLocalization` */ localization?: Partial; /** Password reset URL that users must click to reset their password */ url: string; }