import { Heading } from '@react-email/heading'; import { Text } from '@react-email/text'; import { EmailContainer } from '../components'; import type { EmailBaseProps } from '../types'; // PRO-20639: the written confirmation the IRS requires when an owner // withdraws consent to get 1099s by email. Fixed text; teams can't edit it. export const Tax1099ConsentWithdrawnEmailTemplate = ({ mode, user, tenant, withdrawnAt, address, }: { mode: EmailBaseProps['mode']; user: EmailBaseProps['user']; tenant: EmailBaseProps['tenant']; /** When the owner withdrew; the withdrawal takes effect that day. */ withdrawnAt: string; address: string | null; }) => { // The team stores no time zone. Pacific time keeps an evening withdrawal // anywhere in the mainland US on the day the owner made it. const effectiveOn = new Intl.DateTimeFormat('en-US', { timeZone: 'America/Los_Angeles', month: 'long', day: 'numeric', year: 'numeric', }).format(new Date(withdrawnAt)); return ( {user.firstName ? `Hi ${user.firstName},` : 'Hi there,'} You withdrew your consent to get your 1099s from {tenant.name} by email only. The withdrawal takes effect on {effectiveOn}. From that date, {tenant.name} mails your 1099s to{' '} {address || 'the address on Tax info in your owner portal'}, with a copy by email. Each 1099 also stays in Tax Statements in your owner portal. To get your 1099s by email only again, give your consent on Tax info in your owner portal. If you did not make this change, contact{' '} {tenant.name} right away. ); };