import { Heading } from '@react-email/heading'; import { Text } from '@react-email/text'; import { EmailContainer } from '../components'; import type { EmailBaseProps } from '../types'; export type BankAccountChangedEmailTemplateProps = { mode: EmailBaseProps['mode']; user: EmailBaseProps['user']; tenant: EmailBaseProps['tenant']; // Added: the payee had no bank account before. bankAccount: { last4: string; changedOn: string; added: boolean }; }; export const BankAccountChangedEmailTemplate = ({ mode, user, tenant, bankAccount, }: BankAccountChangedEmailTemplateProps) => ( {user.firstName ? `Hi ${user.firstName},` : 'Hi there,'} {bankAccount.added ? ( A bank account for payments from {tenant.name} was added on{' '} {bankAccount.changedOn}. Future payments go to the account ending in{' '} {bankAccount.last4}. ) : ( The bank account {tenant.name} pays you to was changed on{' '} {bankAccount.changedOn}. Future payments go to the account ending in{' '} {bankAccount.last4}. A payment already on its way still goes to the previous account. )} If you did not make or request this{' '} {bankAccount.added ? 'addition' : 'change'}, contact {tenant.name} right away. );