import { Text } from '@react-email/text'; import { EmailContainer } from './EmailContainer'; import { EmailHeading } from './EmailHeading'; import type { EmailBaseProps } from '../types'; import { parseEmailHtml } from './utils'; import { Button } from './Button'; export type ActionEmailData = { subject: string; shortDescription: string; banner?: string; header: string; bodyOne: string; bodyTwo: string; href: string; buttonText: string; }; export interface ActionEmailTemplateProps extends EmailBaseProps { data: ActionEmailData; } export const ActionEmailTemplate = ({ data, eyebrow, tenant, themeColors, mode, user, listing, month, unsubscribeHref, }: ActionEmailTemplateProps & { eyebrow: string }) => { return ( {data.header?.trim() || `Welcome to ${tenant.name}!`} {data.banner?.trim() && ( {data.banner.trim()} )}
dangerouslySetInnerHTML={{ __html: parseEmailHtml(data.bodyOne, { href: data.href, userName: user.firstName || '', date: month || '', listingName: listing || '', }), }} />