import { Heading } from '@react-email/heading'; import { Text } from '@react-email/text'; import { Button } from '../components/Button'; import { EmailContainer } from '../components/EmailContainer'; import { THEME_COLORS } from '../theme'; import type { EmailBaseProps } from '../types'; export type BankAccountChangedTeamAdminEmailTemplateProps = { mode: EmailBaseProps['mode']; tenant: EmailBaseProps['tenant']; contact: { name: string; type: 'owner' | 'vendor' }; // Added: the contact had no bank account before. bankAccount: { last4: string; changedOn: string; changedBy: string | null; added: boolean; }; href: string; }; export const BankAccountChangedTeamAdminEmailTemplate = ({ mode, tenant, contact, bankAccount, href, }: BankAccountChangedTeamAdminEmailTemplateProps) => ( Bank details {bankAccount.added ? 'added' : 'changed'} The bank account of {contact.type} {contact.name} was{' '} {bankAccount.added ? 'added' : 'changed'} on {bankAccount.changedOn} {bankAccount.changedBy ? ` by ${bankAccount.changedBy}` : ''}. Future payments go to the account ending in {bankAccount.last4}. If you did not expect this change, confirm it with {contact.name} by phone before the next payment.