@vrplatform/email 1.0.2-stage.44636953783 → 1.0.2-stage.44762129353

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,5 +41,7 @@ export declare const OwnerStatementEmailTemplate: ({ data, tenant, themeColors,
41
41
  details: string[];
42
42
  /** Opens the payment page. */
43
43
  payHref?: string;
44
+ /** How the owner can pay on the payment page. */
45
+ methods?: ('ach' | 'card')[];
44
46
  };
45
47
  }) => import("react").JSX.Element;
@@ -133,7 +133,11 @@ const OwnerStatementEmailTemplate = ({ data, tenant, themeColors, mode, user, li
133
133
  ? 'Pay again'
134
134
  : payment.kind === 'reserveTopUp'
135
135
  ? 'Pay balance'
136
- : 'Pay Deficit Balance', themeColors: themeColors, style: { marginTop: '20px', marginBottom: '12px' } }), (0, jsx_runtime_1.jsx)(text_1.Text, { style: { color: mutedColor, fontSize: 12, margin: 0 }, children: "Bank transfer (ACH), secured by Stripe" })] }))] })), (0, jsx_runtime_1.jsx)(Button_1.Button, { href: data.href, mode: mode, "data-testid": "view-owner-statement-button", label: data.buttonText?.trim() || 'View statement', themeColors: themeColors, style: {
136
+ : 'Pay Deficit Balance', themeColors: themeColors, style: { marginTop: '20px', marginBottom: '12px' } }), (0, jsx_runtime_1.jsx)(text_1.Text, { style: { color: mutedColor, fontSize: 12, margin: 0 }, children: !payment.methods?.includes('card')
137
+ ? 'Bank transfer (ACH), secured by Stripe'
138
+ : payment.methods.includes('ach')
139
+ ? 'Bank transfer (ACH) or card, secured by Stripe'
140
+ : 'Card, secured by Stripe' })] }))] })), (0, jsx_runtime_1.jsx)(Button_1.Button, { href: data.href, mode: mode, "data-testid": "view-owner-statement-button", label: data.buttonText?.trim() || 'View statement', themeColors: themeColors, style: {
137
141
  marginTop: '24px',
138
142
  marginBottom: '32px',
139
143
  ...(payment?.payHref && {
@@ -1 +1 @@
1
- {"version":3,"file":"OwnerStatementEmailTemplate.js","sourceRoot":"src/","sources":["templates/Ow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BACH,GACD,EAED,SAAS,IAAI,CACZ,iCACE,KAAK,EAAE;oBACL,OAAO,EAAE,MAAM;oBACf,eAAe,EAAE,SAAS;oBAC1B,YAAY,EAAE,KAAK;oBACnB,YAAY,EAAE,MAAM;iBACrB,aAED,uBAAC,WAAI,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,8BAE5C,EACP,wBAAC,WAAI,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,6DACZ,GAAG,EAC/C,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,WAAW,gGAExC,EACP,uBAAC,eAAM,IACL,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,IAAI,iBACE,mCAAmC,EAC/C,KAAK,EAAC,oBAAoB,EAC1B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE;4BACL,UAAU,EAAE,SAAS;4BACrB,MAAM,EAAE,aAAa,WAAW,CAAC,CAAC,CAAC,EAAE;4BACrC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;4BACrB,SAAS,EAAE,MAAM;4BACjB,YAAY,EAAE,CAAC;yBAChB,GACD,IACE,CACP,EAED;gBACE,6FAA6F;gBAC7F,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,GACxD,IACa,CAClB,CAAC;AACJ,CAAC,CAAC;AAxQW,QAAA,2BAA2B,GAA3B,2BAA2B,CAwQtC","sourcesContent":["import { Text } from '@react-email/text';\nimport {\n EMAIL_ACTION_LINK_COMPONENT,\n EMAIL_DATE_COMPONENT,\n EMAIL_LISTING_COMPONENT,\n EMAIL_USER_NAME_COMPONENT,\n} from '../extensions';\nimport type {\n ActionEmailData,\n ActionEmailTemplateProps,\n} from '../components/ActionEmailTemplate';\nimport { Button } from '../components/Button';\nimport { EmailContainer } from '../components/EmailContainer';\nimport { EmailHeading } from '../components/EmailHeading';\nimport { parseEmailHtml } from '../components/utils';\n\nexport const getDefaultOwnerStatementEmailData = (\n mode: 'tag' | 'text',\n args: {\n appName: string;\n ownerStatementHref: string;\n listingName: string;\n userName: string;\n month: string;\n }\n): ActionEmailData => {\n const ownerStatementHref =\n mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.ownerStatementHref;\n\n const listingName =\n mode === 'tag' ? EMAIL_LISTING_COMPONENT : args.listingName;\n const month = mode === 'tag' ? EMAIL_DATE_COMPONENT : args.month;\n const userName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.userName;\n\n // Owners open the statement by link without a login and viewers log in to\n // the owner portal, so the text names neither. Subject and preview text are\n // plain text without tokens, so a saved template must not keep the editor's\n // sample month and listing.\n return {\n subject:\n mode === 'tag'\n ? 'Your owner statement is ready'\n : `Your ${args.month} owner statement for ${args.listingName}`,\n shortDescription:\n mode === 'tag'\n ? 'Your owner statement is ready to view.'\n : `Your ${args.month} statement for ${args.listingName} is ready to view.`,\n header: 'Your owner statement is ready',\n bodyOne: `<p>Hi ${userName},</p><p>${args.appName} published your ${month} owner statement for ${listingName}. Open it with the button below.</p>`,\n buttonText: 'View statement',\n bodyTwo: `<p style=\"color:#737373;font-size:13px\">If the button doesn't work, copy this link into your browser: ${ownerStatementHref}</p>`,\n href: args.ownerStatementHref,\n };\n};\n\n/**\n * Subject and text of the emails about an owner payment, which a team's saved\n * statement template does not change: the receipt once Stripe has the money,\n * and the failed-payment email.\n */\nexport const getOwnerPaymentEmailData = (\n kind: 'received' | 'failed',\n args: {\n appName: string;\n ownerStatementHref: string;\n listingName: string;\n userName: string;\n month: string;\n }\n): ActionEmailData => ({\n subject:\n kind === 'received'\n ? `Payment received for your ${args.month} statement for ${args.listingName}`\n : `Your payment for the ${args.month} statement for ${args.listingName} failed`,\n shortDescription:\n kind === 'received'\n ? `${args.appName} received your payment.`\n : 'Your bank did not complete your payment.',\n header: kind === 'received' ? 'Payment received' : 'Your payment failed',\n bodyOne:\n kind === 'received'\n ? `<p>Hi ${args.userName},</p><p>${args.appName} received your payment for your ${args.month} owner statement for ${args.listingName}. Thank you.</p>`\n : `<p>Hi ${args.userName},</p><p>Your bank did not complete your payment for your ${args.month} owner statement for ${args.listingName}. Pay again with the button below.</p>`,\n buttonText: 'View statement',\n bodyTwo: `<p style=\"color:#737373;font-size:13px\">If the button doesn't work, copy this link into your browser: ${args.ownerStatementHref}</p>`,\n href: args.ownerStatementHref,\n});\n\nconst mutedColor = '#737373';\nconst borderColor = '#e5e7eb';\nconst paymentColors = {\n due: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },\n reserveTopUp: { background: '#eff6ff', border: '#bfdbfe', text: '#1e40af' },\n failed: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },\n received: { background: '#f0fdf4', border: '#bbf7d0', text: '#166534' },\n};\n\nexport const OwnerStatementEmailTemplate = ({\n data,\n tenant,\n themeColors,\n mode,\n user,\n listing,\n month,\n unsubscribeHref,\n renewHref,\n payment,\n yearEnd,\n}: ActionEmailTemplateProps & {\n /** Requests a new no-login link once the emailed one has expired. */\n renewHref?: string;\n /**\n * A year-end statement: its eyebrow, the Fiscal year (`month`) and Listings\n * rows, and the link opening only the year-end statement.\n */\n yearEnd?: { listings?: string };\n /**\n * The owner payment block: what is due with the pay button, a reserve\n * top-up due when the balance end is not negative, a payment received, or a\n * payment that failed.\n */\n payment?: {\n kind: 'due' | 'reserveTopUp' | 'received' | 'failed';\n /** Formatted amount, such as `$1,284.50`. */\n amount: string;\n /** Short lines under the amount, such as `Please pay by Oct 16, 2026`. */\n details: string[];\n /** Opens the payment page. */\n payHref?: string;\n };\n}) => {\n const parse = (html: string) =>\n parseEmailHtml(html, {\n href: data.href,\n userName: user.firstName || '',\n date: month || '',\n listingName: listing || '',\n });\n\n return (\n <EmailContainer\n title={data.subject}\n shortDescription={data.shortDescription}\n tenant={tenant}\n mode={mode}\n unsubscribeHref={unsubscribeHref}\n >\n <EmailHeading\n eyebrow={yearEnd ? 'Year-end statement' : 'Owner statement'}\n themeColors={themeColors}\n >\n {data.header?.trim() || 'Your owner statement is ready'}\n </EmailHeading>\n\n {data.banner?.trim() && (\n <Text\n style={{\n padding: '16px 20px',\n backgroundColor: '#f8f9fa',\n borderLeft: `3px solid ${themeColors[8]}`,\n borderRadius: '4px',\n margin: '0 0 32px',\n whiteSpace: 'pre-line',\n }}\n >\n {data.banner.trim()}\n </Text>\n )}\n\n <div\n // biome-ignore lint/security/noDangerouslySetInnerHtml: values are escaped by parseEmailHtml\n dangerouslySetInnerHTML={{ __html: parse(data.bodyOne) }}\n />\n\n {(listing || month || yearEnd?.listings) && (\n <table\n role=\"presentation\"\n cellPadding={0}\n cellSpacing={0}\n width=\"100%\"\n style={{\n border: `1px solid ${borderColor}`,\n borderRadius: '8px',\n borderCollapse: 'separate',\n margin: '24px 0 0',\n }}\n >\n <tbody>\n {(yearEnd\n ? [\n ['Fiscal year', month],\n ['Listings', yearEnd.listings],\n ]\n : [\n ['Property', listing],\n ['Statement', month],\n ]\n ).map(([label, value], index) =>\n value ? (\n <tr key={label}>\n <td\n style={{\n padding: '14px 20px',\n color: mutedColor,\n fontSize: 14,\n borderTop: index ? `1px solid ${borderColor}` : 'none',\n }}\n >\n {label}\n </td>\n <td\n style={{\n padding: '14px 20px',\n fontSize: 14,\n fontWeight: 600,\n textAlign: 'right',\n borderTop: index ? `1px solid ${borderColor}` : 'none',\n }}\n >\n {value}\n </td>\n </tr>\n ) : null\n )}\n </tbody>\n </table>\n )}\n\n {payment && (\n <div\n data-testid=\"owner-payment-block\"\n style={{\n padding: '24px 20px',\n backgroundColor: paymentColors[payment.kind].background,\n border: `1px solid ${paymentColors[payment.kind].border}`,\n borderRadius: '8px',\n margin: '24px 0 0',\n textAlign: 'center',\n }}\n >\n <Text\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 14,\n fontWeight: 600,\n margin: 0,\n }}\n >\n {payment.kind === 'due'\n ? 'Balance due'\n : payment.kind === 'reserveTopUp'\n ? 'Reserve top-up due'\n : payment.kind === 'received'\n ? 'Payment received'\n : 'Payment failed'}\n </Text>\n <Text\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 32,\n fontWeight: 700,\n lineHeight: '40px',\n margin: '8px 0',\n }}\n >\n {payment.amount}\n </Text>\n {payment.details.map((detail) => (\n <Text\n key={detail}\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 14,\n margin: '4px 0 0',\n }}\n >\n {detail}\n </Text>\n ))}\n {payment.payHref && (\n <>\n <Button\n href={payment.payHref}\n mode={mode}\n data-testid=\"pay-owner-balance-button\"\n label={\n payment.kind === 'failed'\n ? 'Pay again'\n : payment.kind === 'reserveTopUp'\n ? 'Pay balance'\n : 'Pay Deficit Balance'\n }\n themeColors={themeColors}\n style={{ marginTop: '20px', marginBottom: '12px' }}\n />\n <Text style={{ color: mutedColor, fontSize: 12, margin: 0 }}>\n Bank transfer (ACH), secured by Stripe\n </Text>\n </>\n )}\n </div>\n )}\n\n <Button\n href={data.href}\n mode={mode}\n data-testid=\"view-owner-statement-button\"\n label={data.buttonText?.trim() || 'View statement'}\n themeColors={themeColors}\n style={{\n marginTop: '24px',\n marginBottom: '32px',\n ...(payment?.payHref && {\n background: '#ffffff',\n border: `1px solid ${themeColors[8]}`,\n color: themeColors[8],\n }),\n }}\n />\n\n {renewHref && (\n <div\n style={{\n padding: '20px',\n backgroundColor: '#f8f9fa',\n borderRadius: '8px',\n marginBottom: '32px',\n }}\n >\n <Text style={{ fontWeight: 600, margin: '0 0 4px' }}>\n Link expired?\n </Text>\n <Text style={{ color: mutedColor, fontSize: 14, margin: 0 }}>\n For your security, this link opens only this{' '}\n {yearEnd ? 'year-end statement' : 'statement'} and works for 7 days.\n After that, request a new one and we'll email it to this address.\n </Text>\n <Button\n href={renewHref}\n mode={mode}\n data-testid=\"renew-owner-statement-link-button\"\n label=\"Send me a new link\"\n themeColors={themeColors}\n style={{\n background: '#ffffff',\n border: `1px solid ${themeColors[8]}`,\n color: themeColors[8],\n marginTop: '16px',\n marginBottom: 0,\n }}\n />\n </div>\n )}\n\n <div\n // biome-ignore lint/security/noDangerouslySetInnerHtml: values are escaped by parseEmailHtml\n dangerouslySetInnerHTML={{ __html: parse(data.bodyTwo) }}\n />\n </EmailContainer>\n );\n};\n"]}
1
+ {"version":3,"file":"OwnerStatementEmailTemplate.js","sourceRoot":"src/","sources":["templates/OwnerStatementEmailTemplate.tsx"],"names":[],"mappings":";;;;AAAA,4CAAyC;AACzC,8CAKuB;AAKvB,iDAA8C;AAC9C,iEAA8D;AAC9D,6DAA0D;AAC1D,+CAAqD;AAE9C,MAAM,iCAAiC,GAAG,CAC/C,IAAoB,EACpB,IAMC,EACgB,EAAE;IACnB,MAAM,kBAAkB,GACtB,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,wCAA2B,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC;IAEzE,MAAM,WAAW,GACf,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,oCAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAC9D,MAAM,KAAK,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,iCAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACjE,MAAM,QAAQ,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,sCAAyB,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;IAE5E,0EAA0E;IAC1E,4EAA4E;IAC5E,4EAA4E;IAC5E,4BAA4B;IAC5B,OAAO;QACL,OAAO,EACL,IAAI,KAAK,KAAK;YACZ,CAAC,CAAC,+BAA+B;YACjC,CAAC,CAAC,QAAQ,IAAI,CAAC,KAAK,wBAAwB,IAAI,CAAC,WAAW,EAAE;QAClE,gBAAgB,EACd,IAAI,KAAK,KAAK;YACZ,CAAC,CAAC,wCAAwC;YAC1C,CAAC,CAAC,QAAQ,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SAAS,EAAE,MAAM;4BACjB,YAAY,EAAE,CAAC;yBAChB,GACD,IACE,CACP,EAED;gBACE,6FAA6F;gBAC7F,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,GACxD,IACa,CAClB,CAAC;AACJ,CAAC,CAAC;AA9QW,QAAA,2BAA2B,GAA3B,2BAA2B,CA8QtC","sourcesContent":["import { Text } from '@react-email/text';\nimport {\n EMAIL_ACTION_LINK_COMPONENT,\n EMAIL_DATE_COMPONENT,\n EMAIL_LISTING_COMPONENT,\n EMAIL_USER_NAME_COMPONENT,\n} from '../extensions';\nimport type {\n ActionEmailData,\n ActionEmailTemplateProps,\n} from '../components/ActionEmailTemplate';\nimport { Button } from '../components/Button';\nimport { EmailContainer } from '../components/EmailContainer';\nimport { EmailHeading } from '../components/EmailHeading';\nimport { parseEmailHtml } from '../components/utils';\n\nexport const getDefaultOwnerStatementEmailData = (\n mode: 'tag' | 'text',\n args: {\n appName: string;\n ownerStatementHref: string;\n listingName: string;\n userName: string;\n month: string;\n }\n): ActionEmailData => {\n const ownerStatementHref =\n mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.ownerStatementHref;\n\n const listingName =\n mode === 'tag' ? EMAIL_LISTING_COMPONENT : args.listingName;\n const month = mode === 'tag' ? EMAIL_DATE_COMPONENT : args.month;\n const userName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.userName;\n\n // Owners open the statement by link without a login and viewers log in to\n // the owner portal, so the text names neither. Subject and preview text are\n // plain text without tokens, so a saved template must not keep the editor's\n // sample month and listing.\n return {\n subject:\n mode === 'tag'\n ? 'Your owner statement is ready'\n : `Your ${args.month} owner statement for ${args.listingName}`,\n shortDescription:\n mode === 'tag'\n ? 'Your owner statement is ready to view.'\n : `Your ${args.month} statement for ${args.listingName} is ready to view.`,\n header: 'Your owner statement is ready',\n bodyOne: `<p>Hi ${userName},</p><p>${args.appName} published your ${month} owner statement for ${listingName}. Open it with the button below.</p>`,\n buttonText: 'View statement',\n bodyTwo: `<p style=\"color:#737373;font-size:13px\">If the button doesn't work, copy this link into your browser: ${ownerStatementHref}</p>`,\n href: args.ownerStatementHref,\n };\n};\n\n/**\n * Subject and text of the emails about an owner payment, which a team's saved\n * statement template does not change: the receipt once Stripe has the money,\n * and the failed-payment email.\n */\nexport const getOwnerPaymentEmailData = (\n kind: 'received' | 'failed',\n args: {\n appName: string;\n ownerStatementHref: string;\n listingName: string;\n userName: string;\n month: string;\n }\n): ActionEmailData => ({\n subject:\n kind === 'received'\n ? `Payment received for your ${args.month} statement for ${args.listingName}`\n : `Your payment for the ${args.month} statement for ${args.listingName} failed`,\n shortDescription:\n kind === 'received'\n ? `${args.appName} received your payment.`\n : 'Your bank did not complete your payment.',\n header: kind === 'received' ? 'Payment received' : 'Your payment failed',\n bodyOne:\n kind === 'received'\n ? `<p>Hi ${args.userName},</p><p>${args.appName} received your payment for your ${args.month} owner statement for ${args.listingName}. Thank you.</p>`\n : `<p>Hi ${args.userName},</p><p>Your bank did not complete your payment for your ${args.month} owner statement for ${args.listingName}. Pay again with the button below.</p>`,\n buttonText: 'View statement',\n bodyTwo: `<p style=\"color:#737373;font-size:13px\">If the button doesn't work, copy this link into your browser: ${args.ownerStatementHref}</p>`,\n href: args.ownerStatementHref,\n});\n\nconst mutedColor = '#737373';\nconst borderColor = '#e5e7eb';\nconst paymentColors = {\n due: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },\n reserveTopUp: { background: '#eff6ff', border: '#bfdbfe', text: '#1e40af' },\n failed: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },\n received: { background: '#f0fdf4', border: '#bbf7d0', text: '#166534' },\n};\n\nexport const OwnerStatementEmailTemplate = ({\n data,\n tenant,\n themeColors,\n mode,\n user,\n listing,\n month,\n unsubscribeHref,\n renewHref,\n payment,\n yearEnd,\n}: ActionEmailTemplateProps & {\n /** Requests a new no-login link once the emailed one has expired. */\n renewHref?: string;\n /**\n * A year-end statement: its eyebrow, the Fiscal year (`month`) and Listings\n * rows, and the link opening only the year-end statement.\n */\n yearEnd?: { listings?: string };\n /**\n * The owner payment block: what is due with the pay button, a reserve\n * top-up due when the balance end is not negative, a payment received, or a\n * payment that failed.\n */\n payment?: {\n kind: 'due' | 'reserveTopUp' | 'received' | 'failed';\n /** Formatted amount, such as `$1,284.50`. */\n amount: string;\n /** Short lines under the amount, such as `Please pay by Oct 16, 2026`. */\n details: string[];\n /** Opens the payment page. */\n payHref?: string;\n /** How the owner can pay on the payment page. */\n methods?: ('ach' | 'card')[];\n };\n}) => {\n const parse = (html: string) =>\n parseEmailHtml(html, {\n href: data.href,\n userName: user.firstName || '',\n date: month || '',\n listingName: listing || '',\n });\n\n return (\n <EmailContainer\n title={data.subject}\n shortDescription={data.shortDescription}\n tenant={tenant}\n mode={mode}\n unsubscribeHref={unsubscribeHref}\n >\n <EmailHeading\n eyebrow={yearEnd ? 'Year-end statement' : 'Owner statement'}\n themeColors={themeColors}\n >\n {data.header?.trim() || 'Your owner statement is ready'}\n </EmailHeading>\n\n {data.banner?.trim() && (\n <Text\n style={{\n padding: '16px 20px',\n backgroundColor: '#f8f9fa',\n borderLeft: `3px solid ${themeColors[8]}`,\n borderRadius: '4px',\n margin: '0 0 32px',\n whiteSpace: 'pre-line',\n }}\n >\n {data.banner.trim()}\n </Text>\n )}\n\n <div\n // biome-ignore lint/security/noDangerouslySetInnerHtml: values are escaped by parseEmailHtml\n dangerouslySetInnerHTML={{ __html: parse(data.bodyOne) }}\n />\n\n {(listing || month || yearEnd?.listings) && (\n <table\n role=\"presentation\"\n cellPadding={0}\n cellSpacing={0}\n width=\"100%\"\n style={{\n border: `1px solid ${borderColor}`,\n borderRadius: '8px',\n borderCollapse: 'separate',\n margin: '24px 0 0',\n }}\n >\n <tbody>\n {(yearEnd\n ? [\n ['Fiscal year', month],\n ['Listings', yearEnd.listings],\n ]\n : [\n ['Property', listing],\n ['Statement', month],\n ]\n ).map(([label, value], index) =>\n value ? (\n <tr key={label}>\n <td\n style={{\n padding: '14px 20px',\n color: mutedColor,\n fontSize: 14,\n borderTop: index ? `1px solid ${borderColor}` : 'none',\n }}\n >\n {label}\n </td>\n <td\n style={{\n padding: '14px 20px',\n fontSize: 14,\n fontWeight: 600,\n textAlign: 'right',\n borderTop: index ? `1px solid ${borderColor}` : 'none',\n }}\n >\n {value}\n </td>\n </tr>\n ) : null\n )}\n </tbody>\n </table>\n )}\n\n {payment && (\n <div\n data-testid=\"owner-payment-block\"\n style={{\n padding: '24px 20px',\n backgroundColor: paymentColors[payment.kind].background,\n border: `1px solid ${paymentColors[payment.kind].border}`,\n borderRadius: '8px',\n margin: '24px 0 0',\n textAlign: 'center',\n }}\n >\n <Text\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 14,\n fontWeight: 600,\n margin: 0,\n }}\n >\n {payment.kind === 'due'\n ? 'Balance due'\n : payment.kind === 'reserveTopUp'\n ? 'Reserve top-up due'\n : payment.kind === 'received'\n ? 'Payment received'\n : 'Payment failed'}\n </Text>\n <Text\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 32,\n fontWeight: 700,\n lineHeight: '40px',\n margin: '8px 0',\n }}\n >\n {payment.amount}\n </Text>\n {payment.details.map((detail) => (\n <Text\n key={detail}\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 14,\n margin: '4px 0 0',\n }}\n >\n {detail}\n </Text>\n ))}\n {payment.payHref && (\n <>\n <Button\n href={payment.payHref}\n mode={mode}\n data-testid=\"pay-owner-balance-button\"\n label={\n payment.kind === 'failed'\n ? 'Pay again'\n : payment.kind === 'reserveTopUp'\n ? 'Pay balance'\n : 'Pay Deficit Balance'\n }\n themeColors={themeColors}\n style={{ marginTop: '20px', marginBottom: '12px' }}\n />\n <Text style={{ color: mutedColor, fontSize: 12, margin: 0 }}>\n {!payment.methods?.includes('card')\n ? 'Bank transfer (ACH), secured by Stripe'\n : payment.methods.includes('ach')\n ? 'Bank transfer (ACH) or card, secured by Stripe'\n : 'Card, secured by Stripe'}\n </Text>\n </>\n )}\n </div>\n )}\n\n <Button\n href={data.href}\n mode={mode}\n data-testid=\"view-owner-statement-button\"\n label={data.buttonText?.trim() || 'View statement'}\n themeColors={themeColors}\n style={{\n marginTop: '24px',\n marginBottom: '32px',\n ...(payment?.payHref && {\n background: '#ffffff',\n border: `1px solid ${themeColors[8]}`,\n color: themeColors[8],\n }),\n }}\n />\n\n {renewHref && (\n <div\n style={{\n padding: '20px',\n backgroundColor: '#f8f9fa',\n borderRadius: '8px',\n marginBottom: '32px',\n }}\n >\n <Text style={{ fontWeight: 600, margin: '0 0 4px' }}>\n Link expired?\n </Text>\n <Text style={{ color: mutedColor, fontSize: 14, margin: 0 }}>\n For your security, this link opens only this{' '}\n {yearEnd ? 'year-end statement' : 'statement'} and works for 7 days.\n After that, request a new one and we'll email it to this address.\n </Text>\n <Button\n href={renewHref}\n mode={mode}\n data-testid=\"renew-owner-statement-link-button\"\n label=\"Send me a new link\"\n themeColors={themeColors}\n style={{\n background: '#ffffff',\n border: `1px solid ${themeColors[8]}`,\n color: themeColors[8],\n marginTop: '16px',\n marginBottom: 0,\n }}\n />\n </div>\n )}\n\n <div\n // biome-ignore lint/security/noDangerouslySetInnerHtml: values are escaped by parseEmailHtml\n dangerouslySetInnerHTML={{ __html: parse(data.bodyTwo) }}\n />\n </EmailContainer>\n );\n};\n"]}
@@ -41,5 +41,7 @@ export declare const OwnerStatementEmailTemplate: ({ data, tenant, themeColors,
41
41
  details: string[];
42
42
  /** Opens the payment page. */
43
43
  payHref?: string;
44
+ /** How the owner can pay on the payment page. */
45
+ methods?: ('ach' | 'card')[];
44
46
  };
45
47
  }) => import("react").JSX.Element;
@@ -128,7 +128,11 @@ export const OwnerStatementEmailTemplate = ({ data, tenant, themeColors, mode, u
128
128
  ? 'Pay again'
129
129
  : payment.kind === 'reserveTopUp'
130
130
  ? 'Pay balance'
131
- : 'Pay Deficit Balance', themeColors: themeColors, style: { marginTop: '20px', marginBottom: '12px' } }), _jsx(Text, { style: { color: mutedColor, fontSize: 12, margin: 0 }, children: "Bank transfer (ACH), secured by Stripe" })] }))] })), _jsx(Button, { href: data.href, mode: mode, "data-testid": "view-owner-statement-button", label: data.buttonText?.trim() || 'View statement', themeColors: themeColors, style: {
131
+ : 'Pay Deficit Balance', themeColors: themeColors, style: { marginTop: '20px', marginBottom: '12px' } }), _jsx(Text, { style: { color: mutedColor, fontSize: 12, margin: 0 }, children: !payment.methods?.includes('card')
132
+ ? 'Bank transfer (ACH), secured by Stripe'
133
+ : payment.methods.includes('ach')
134
+ ? 'Bank transfer (ACH) or card, secured by Stripe'
135
+ : 'Card, secured by Stripe' })] }))] })), _jsx(Button, { href: data.href, mode: mode, "data-testid": "view-owner-statement-button", label: data.buttonText?.trim() || 'View statement', themeColors: themeColors, style: {
132
136
  marginTop: '24px',
133
137
  marginBottom: '32px',
134
138
  ...(payment?.payHref && {
@@ -1 +1 @@
1
- {"version":3,"file":"OwnerStatementEmailTemplate.js","sourceRoot":"src/","sources":["templates/OwnerStatementEmailTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAC/C,IAAoB,EACpB,IAMC,EACgB,EAAE;IACnB,MAAM,kBAAkB,GACtB,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC;IAEzE,M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AC,oBAAoB,CAAC,CAAC,CAAC,WAAW,gGAExC,EACP,KAAC,MAAM,IACL,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,IAAI,iBACE,mCAAmC,EAC/C,KAAK,EAAC,oBAAoB,EAC1B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE;4BACL,UAAU,EAAE,SAAS;4BACrB,MAAM,EAAE,aAAa,WAAW,CAAC,CAAC,CAAC,EAAE;4BACrC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;4BACrB,SAAS,EAAE,MAAM;4BACjB,YAAY,EAAE,CAAC;yBAChB,GACD,IACE,CACP,EAED;gBACE,6FAA6F;gBAC7F,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,GACxD,IACa,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Text } from '@react-email/text';\nimport {\n EMAIL_ACTION_LINK_COMPONENT,\n EMAIL_DATE_COMPONENT,\n EMAIL_LISTING_COMPONENT,\n EMAIL_USER_NAME_COMPONENT,\n} from '../extensions';\nimport type {\n ActionEmailData,\n ActionEmailTemplateProps,\n} from '../components/ActionEmailTemplate';\nimport { Button } from '../components/Button';\nimport { EmailContainer } from '../components/EmailContainer';\nimport { EmailHeading } from '../components/EmailHeading';\nimport { parseEmailHtml } from '../components/utils';\n\nexport const getDefaultOwnerStatementEmailData = (\n mode: 'tag' | 'text',\n args: {\n appName: string;\n ownerStatementHref: string;\n listingName: string;\n userName: string;\n month: string;\n }\n): ActionEmailData => {\n const ownerStatementHref =\n mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.ownerStatementHref;\n\n const listingName =\n mode === 'tag' ? EMAIL_LISTING_COMPONENT : args.listingName;\n const month = mode === 'tag' ? EMAIL_DATE_COMPONENT : args.month;\n const userName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.userName;\n\n // Owners open the statement by link without a login and viewers log in to\n // the owner portal, so the text names neither. Subject and preview text are\n // plain text without tokens, so a saved template must not keep the editor's\n // sample month and listing.\n return {\n subject:\n mode === 'tag'\n ? 'Your owner statement is ready'\n : `Your ${args.month} owner statement for ${args.listingName}`,\n shortDescription:\n mode === 'tag'\n ? 'Your owner statement is ready to view.'\n : `Your ${args.month} statement for ${args.listingName} is ready to view.`,\n header: 'Your owner statement is ready',\n bodyOne: `<p>Hi ${userName},</p><p>${args.appName} published your ${month} owner statement for ${listingName}. Open it with the button below.</p>`,\n buttonText: 'View statement',\n bodyTwo: `<p style=\"color:#737373;font-size:13px\">If the button doesn't work, copy this link into your browser: ${ownerStatementHref}</p>`,\n href: args.ownerStatementHref,\n };\n};\n\n/**\n * Subject and text of the emails about an owner payment, which a team's saved\n * statement template does not change: the receipt once Stripe has the money,\n * and the failed-payment email.\n */\nexport const getOwnerPaymentEmailData = (\n kind: 'received' | 'failed',\n args: {\n appName: string;\n ownerStatementHref: string;\n listingName: string;\n userName: string;\n month: string;\n }\n): ActionEmailData => ({\n subject:\n kind === 'received'\n ? `Payment received for your ${args.month} statement for ${args.listingName}`\n : `Your payment for the ${args.month} statement for ${args.listingName} failed`,\n shortDescription:\n kind === 'received'\n ? `${args.appName} received your payment.`\n : 'Your bank did not complete your payment.',\n header: kind === 'received' ? 'Payment received' : 'Your payment failed',\n bodyOne:\n kind === 'received'\n ? `<p>Hi ${args.userName},</p><p>${args.appName} received your payment for your ${args.month} owner statement for ${args.listingName}. Thank you.</p>`\n : `<p>Hi ${args.userName},</p><p>Your bank did not complete your payment for your ${args.month} owner statement for ${args.listingName}. Pay again with the button below.</p>`,\n buttonText: 'View statement',\n bodyTwo: `<p style=\"color:#737373;font-size:13px\">If the button doesn't work, copy this link into your browser: ${args.ownerStatementHref}</p>`,\n href: args.ownerStatementHref,\n});\n\nconst mutedColor = '#737373';\nconst borderColor = '#e5e7eb';\nconst paymentColors = {\n due: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },\n reserveTopUp: { background: '#eff6ff', border: '#bfdbfe', text: '#1e40af' },\n failed: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },\n received: { background: '#f0fdf4', border: '#bbf7d0', text: '#166534' },\n};\n\nexport const OwnerStatementEmailTemplate = ({\n data,\n tenant,\n themeColors,\n mode,\n user,\n listing,\n month,\n unsubscribeHref,\n renewHref,\n payment,\n yearEnd,\n}: ActionEmailTemplateProps & {\n /** Requests a new no-login link once the emailed one has expired. */\n renewHref?: string;\n /**\n * A year-end statement: its eyebrow, the Fiscal year (`month`) and Listings\n * rows, and the link opening only the year-end statement.\n */\n yearEnd?: { listings?: string };\n /**\n * The owner payment block: what is due with the pay button, a reserve\n * top-up due when the balance end is not negative, a payment received, or a\n * payment that failed.\n */\n payment?: {\n kind: 'due' | 'reserveTopUp' | 'received' | 'failed';\n /** Formatted amount, such as `$1,284.50`. */\n amount: string;\n /** Short lines under the amount, such as `Please pay by Oct 16, 2026`. */\n details: string[];\n /** Opens the payment page. */\n payHref?: string;\n };\n}) => {\n const parse = (html: string) =>\n parseEmailHtml(html, {\n href: data.href,\n userName: user.firstName || '',\n date: month || '',\n listingName: listing || '',\n });\n\n return (\n <EmailContainer\n title={data.subject}\n shortDescription={data.shortDescription}\n tenant={tenant}\n mode={mode}\n unsubscribeHref={unsubscribeHref}\n >\n <EmailHeading\n eyebrow={yearEnd ? 'Year-end statement' : 'Owner statement'}\n themeColors={themeColors}\n >\n {data.header?.trim() || 'Your owner statement is ready'}\n </EmailHeading>\n\n {data.banner?.trim() && (\n <Text\n style={{\n padding: '16px 20px',\n backgroundColor: '#f8f9fa',\n borderLeft: `3px solid ${themeColors[8]}`,\n borderRadius: '4px',\n margin: '0 0 32px',\n whiteSpace: 'pre-line',\n }}\n >\n {data.banner.trim()}\n </Text>\n )}\n\n <div\n // biome-ignore lint/security/noDangerouslySetInnerHtml: values are escaped by parseEmailHtml\n dangerouslySetInnerHTML={{ __html: parse(data.bodyOne) }}\n />\n\n {(listing || month || yearEnd?.listings) && (\n <table\n role=\"presentation\"\n cellPadding={0}\n cellSpacing={0}\n width=\"100%\"\n style={{\n border: `1px solid ${borderColor}`,\n borderRadius: '8px',\n borderCollapse: 'separate',\n margin: '24px 0 0',\n }}\n >\n <tbody>\n {(yearEnd\n ? [\n ['Fiscal year', month],\n ['Listings', yearEnd.listings],\n ]\n : [\n ['Property', listing],\n ['Statement', month],\n ]\n ).map(([label, value], index) =>\n value ? (\n <tr key={label}>\n <td\n style={{\n padding: '14px 20px',\n color: mutedColor,\n fontSize: 14,\n borderTop: index ? `1px solid ${borderColor}` : 'none',\n }}\n >\n {label}\n </td>\n <td\n style={{\n padding: '14px 20px',\n fontSize: 14,\n fontWeight: 600,\n textAlign: 'right',\n borderTop: index ? `1px solid ${borderColor}` : 'none',\n }}\n >\n {value}\n </td>\n </tr>\n ) : null\n )}\n </tbody>\n </table>\n )}\n\n {payment && (\n <div\n data-testid=\"owner-payment-block\"\n style={{\n padding: '24px 20px',\n backgroundColor: paymentColors[payment.kind].background,\n border: `1px solid ${paymentColors[payment.kind].border}`,\n borderRadius: '8px',\n margin: '24px 0 0',\n textAlign: 'center',\n }}\n >\n <Text\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 14,\n fontWeight: 600,\n margin: 0,\n }}\n >\n {payment.kind === 'due'\n ? 'Balance due'\n : payment.kind === 'reserveTopUp'\n ? 'Reserve top-up due'\n : payment.kind === 'received'\n ? 'Payment received'\n : 'Payment failed'}\n </Text>\n <Text\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 32,\n fontWeight: 700,\n lineHeight: '40px',\n margin: '8px 0',\n }}\n >\n {payment.amount}\n </Text>\n {payment.details.map((detail) => (\n <Text\n key={detail}\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 14,\n margin: '4px 0 0',\n }}\n >\n {detail}\n </Text>\n ))}\n {payment.payHref && (\n <>\n <Button\n href={payment.payHref}\n mode={mode}\n data-testid=\"pay-owner-balance-button\"\n label={\n payment.kind === 'failed'\n ? 'Pay again'\n : payment.kind === 'reserveTopUp'\n ? 'Pay balance'\n : 'Pay Deficit Balance'\n }\n themeColors={themeColors}\n style={{ marginTop: '20px', marginBottom: '12px' }}\n />\n <Text style={{ color: mutedColor, fontSize: 12, margin: 0 }}>\n Bank transfer (ACH), secured by Stripe\n </Text>\n </>\n )}\n </div>\n )}\n\n <Button\n href={data.href}\n mode={mode}\n data-testid=\"view-owner-statement-button\"\n label={data.buttonText?.trim() || 'View statement'}\n themeColors={themeColors}\n style={{\n marginTop: '24px',\n marginBottom: '32px',\n ...(payment?.payHref && {\n background: '#ffffff',\n border: `1px solid ${themeColors[8]}`,\n color: themeColors[8],\n }),\n }}\n />\n\n {renewHref && (\n <div\n style={{\n padding: '20px',\n backgroundColor: '#f8f9fa',\n borderRadius: '8px',\n marginBottom: '32px',\n }}\n >\n <Text style={{ fontWeight: 600, margin: '0 0 4px' }}>\n Link expired?\n </Text>\n <Text style={{ color: mutedColor, fontSize: 14, margin: 0 }}>\n For your security, this link opens only this{' '}\n {yearEnd ? 'year-end statement' : 'statement'} and works for 7 days.\n After that, request a new one and we'll email it to this address.\n </Text>\n <Button\n href={renewHref}\n mode={mode}\n data-testid=\"renew-owner-statement-link-button\"\n label=\"Send me a new link\"\n themeColors={themeColors}\n style={{\n background: '#ffffff',\n border: `1px solid ${themeColors[8]}`,\n color: themeColors[8],\n marginTop: '16px',\n marginBottom: 0,\n }}\n />\n </div>\n )}\n\n <div\n // biome-ignore lint/security/noDangerouslySetInnerHtml: values are escaped by parseEmailHtml\n dangerouslySetInnerHTML={{ __html: parse(data.bodyTwo) }}\n />\n </EmailContainer>\n );\n};\n"]}
1
+ {"version":3,"file":"OwnerStatementEmailTemplate.js","sourceRoot":"src/","sources":["templates/OwnerStatementEmailTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,eAAe,CA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MPONENT,\n EMAIL_LISTING_COMPONENT,\n EMAIL_USER_NAME_COMPONENT,\n} from '../extensions';\nimport type {\n ActionEmailData,\n ActionEmailTemplateProps,\n} from '../components/ActionEmailTemplate';\nimport { Button } from '../components/Button';\nimport { EmailContainer } from '../components/EmailContainer';\nimport { EmailHeading } from '../components/EmailHeading';\nimport { parseEmailHtml } from '../components/utils';\n\nexport const getDefaultOwnerStatementEmailData = (\n mode: 'tag' | 'text',\n args: {\n appName: string;\n ownerStatementHref: string;\n listingName: string;\n userName: string;\n month: string;\n }\n): ActionEmailData => {\n const ownerStatementHref =\n mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.ownerStatementHref;\n\n const listingName =\n mode === 'tag' ? EMAIL_LISTING_COMPONENT : args.listingName;\n const month = mode === 'tag' ? EMAIL_DATE_COMPONENT : args.month;\n const userName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.userName;\n\n // Owners open the statement by link without a login and viewers log in to\n // the owner portal, so the text names neither. Subject and preview text are\n // plain text without tokens, so a saved template must not keep the editor's\n // sample month and listing.\n return {\n subject:\n mode === 'tag'\n ? 'Your owner statement is ready'\n : `Your ${args.month} owner statement for ${args.listingName}`,\n shortDescription:\n mode === 'tag'\n ? 'Your owner statement is ready to view.'\n : `Your ${args.month} statement for ${args.listingName} is ready to view.`,\n header: 'Your owner statement is ready',\n bodyOne: `<p>Hi ${userName},</p><p>${args.appName} published your ${month} owner statement for ${listingName}. Open it with the button below.</p>`,\n buttonText: 'View statement',\n bodyTwo: `<p style=\"color:#737373;font-size:13px\">If the button doesn't work, copy this link into your browser: ${ownerStatementHref}</p>`,\n href: args.ownerStatementHref,\n };\n};\n\n/**\n * Subject and text of the emails about an owner payment, which a team's saved\n * statement template does not change: the receipt once Stripe has the money,\n * and the failed-payment email.\n */\nexport const getOwnerPaymentEmailData = (\n kind: 'received' | 'failed',\n args: {\n appName: string;\n ownerStatementHref: string;\n listingName: string;\n userName: string;\n month: string;\n }\n): ActionEmailData => ({\n subject:\n kind === 'received'\n ? `Payment received for your ${args.month} statement for ${args.listingName}`\n : `Your payment for the ${args.month} statement for ${args.listingName} failed`,\n shortDescription:\n kind === 'received'\n ? `${args.appName} received your payment.`\n : 'Your bank did not complete your payment.',\n header: kind === 'received' ? 'Payment received' : 'Your payment failed',\n bodyOne:\n kind === 'received'\n ? `<p>Hi ${args.userName},</p><p>${args.appName} received your payment for your ${args.month} owner statement for ${args.listingName}. Thank you.</p>`\n : `<p>Hi ${args.userName},</p><p>Your bank did not complete your payment for your ${args.month} owner statement for ${args.listingName}. Pay again with the button below.</p>`,\n buttonText: 'View statement',\n bodyTwo: `<p style=\"color:#737373;font-size:13px\">If the button doesn't work, copy this link into your browser: ${args.ownerStatementHref}</p>`,\n href: args.ownerStatementHref,\n});\n\nconst mutedColor = '#737373';\nconst borderColor = '#e5e7eb';\nconst paymentColors = {\n due: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },\n reserveTopUp: { background: '#eff6ff', border: '#bfdbfe', text: '#1e40af' },\n failed: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },\n received: { background: '#f0fdf4', border: '#bbf7d0', text: '#166534' },\n};\n\nexport const OwnerStatementEmailTemplate = ({\n data,\n tenant,\n themeColors,\n mode,\n user,\n listing,\n month,\n unsubscribeHref,\n renewHref,\n payment,\n yearEnd,\n}: ActionEmailTemplateProps & {\n /** Requests a new no-login link once the emailed one has expired. */\n renewHref?: string;\n /**\n * A year-end statement: its eyebrow, the Fiscal year (`month`) and Listings\n * rows, and the link opening only the year-end statement.\n */\n yearEnd?: { listings?: string };\n /**\n * The owner payment block: what is due with the pay button, a reserve\n * top-up due when the balance end is not negative, a payment received, or a\n * payment that failed.\n */\n payment?: {\n kind: 'due' | 'reserveTopUp' | 'received' | 'failed';\n /** Formatted amount, such as `$1,284.50`. */\n amount: string;\n /** Short lines under the amount, such as `Please pay by Oct 16, 2026`. */\n details: string[];\n /** Opens the payment page. */\n payHref?: string;\n /** How the owner can pay on the payment page. */\n methods?: ('ach' | 'card')[];\n };\n}) => {\n const parse = (html: string) =>\n parseEmailHtml(html, {\n href: data.href,\n userName: user.firstName || '',\n date: month || '',\n listingName: listing || '',\n });\n\n return (\n <EmailContainer\n title={data.subject}\n shortDescription={data.shortDescription}\n tenant={tenant}\n mode={mode}\n unsubscribeHref={unsubscribeHref}\n >\n <EmailHeading\n eyebrow={yearEnd ? 'Year-end statement' : 'Owner statement'}\n themeColors={themeColors}\n >\n {data.header?.trim() || 'Your owner statement is ready'}\n </EmailHeading>\n\n {data.banner?.trim() && (\n <Text\n style={{\n padding: '16px 20px',\n backgroundColor: '#f8f9fa',\n borderLeft: `3px solid ${themeColors[8]}`,\n borderRadius: '4px',\n margin: '0 0 32px',\n whiteSpace: 'pre-line',\n }}\n >\n {data.banner.trim()}\n </Text>\n )}\n\n <div\n // biome-ignore lint/security/noDangerouslySetInnerHtml: values are escaped by parseEmailHtml\n dangerouslySetInnerHTML={{ __html: parse(data.bodyOne) }}\n />\n\n {(listing || month || yearEnd?.listings) && (\n <table\n role=\"presentation\"\n cellPadding={0}\n cellSpacing={0}\n width=\"100%\"\n style={{\n border: `1px solid ${borderColor}`,\n borderRadius: '8px',\n borderCollapse: 'separate',\n margin: '24px 0 0',\n }}\n >\n <tbody>\n {(yearEnd\n ? [\n ['Fiscal year', month],\n ['Listings', yearEnd.listings],\n ]\n : [\n ['Property', listing],\n ['Statement', month],\n ]\n ).map(([label, value], index) =>\n value ? (\n <tr key={label}>\n <td\n style={{\n padding: '14px 20px',\n color: mutedColor,\n fontSize: 14,\n borderTop: index ? `1px solid ${borderColor}` : 'none',\n }}\n >\n {label}\n </td>\n <td\n style={{\n padding: '14px 20px',\n fontSize: 14,\n fontWeight: 600,\n textAlign: 'right',\n borderTop: index ? `1px solid ${borderColor}` : 'none',\n }}\n >\n {value}\n </td>\n </tr>\n ) : null\n )}\n </tbody>\n </table>\n )}\n\n {payment && (\n <div\n data-testid=\"owner-payment-block\"\n style={{\n padding: '24px 20px',\n backgroundColor: paymentColors[payment.kind].background,\n border: `1px solid ${paymentColors[payment.kind].border}`,\n borderRadius: '8px',\n margin: '24px 0 0',\n textAlign: 'center',\n }}\n >\n <Text\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 14,\n fontWeight: 600,\n margin: 0,\n }}\n >\n {payment.kind === 'due'\n ? 'Balance due'\n : payment.kind === 'reserveTopUp'\n ? 'Reserve top-up due'\n : payment.kind === 'received'\n ? 'Payment received'\n : 'Payment failed'}\n </Text>\n <Text\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 32,\n fontWeight: 700,\n lineHeight: '40px',\n margin: '8px 0',\n }}\n >\n {payment.amount}\n </Text>\n {payment.details.map((detail) => (\n <Text\n key={detail}\n style={{\n color: paymentColors[payment.kind].text,\n fontSize: 14,\n margin: '4px 0 0',\n }}\n >\n {detail}\n </Text>\n ))}\n {payment.payHref && (\n <>\n <Button\n href={payment.payHref}\n mode={mode}\n data-testid=\"pay-owner-balance-button\"\n label={\n payment.kind === 'failed'\n ? 'Pay again'\n : payment.kind === 'reserveTopUp'\n ? 'Pay balance'\n : 'Pay Deficit Balance'\n }\n themeColors={themeColors}\n style={{ marginTop: '20px', marginBottom: '12px' }}\n />\n <Text style={{ color: mutedColor, fontSize: 12, margin: 0 }}>\n {!payment.methods?.includes('card')\n ? 'Bank transfer (ACH), secured by Stripe'\n : payment.methods.includes('ach')\n ? 'Bank transfer (ACH) or card, secured by Stripe'\n : 'Card, secured by Stripe'}\n </Text>\n </>\n )}\n </div>\n )}\n\n <Button\n href={data.href}\n mode={mode}\n data-testid=\"view-owner-statement-button\"\n label={data.buttonText?.trim() || 'View statement'}\n themeColors={themeColors}\n style={{\n marginTop: '24px',\n marginBottom: '32px',\n ...(payment?.payHref && {\n background: '#ffffff',\n border: `1px solid ${themeColors[8]}`,\n color: themeColors[8],\n }),\n }}\n />\n\n {renewHref && (\n <div\n style={{\n padding: '20px',\n backgroundColor: '#f8f9fa',\n borderRadius: '8px',\n marginBottom: '32px',\n }}\n >\n <Text style={{ fontWeight: 600, margin: '0 0 4px' }}>\n Link expired?\n </Text>\n <Text style={{ color: mutedColor, fontSize: 14, margin: 0 }}>\n For your security, this link opens only this{' '}\n {yearEnd ? 'year-end statement' : 'statement'} and works for 7 days.\n After that, request a new one and we'll email it to this address.\n </Text>\n <Button\n href={renewHref}\n mode={mode}\n data-testid=\"renew-owner-statement-link-button\"\n label=\"Send me a new link\"\n themeColors={themeColors}\n style={{\n background: '#ffffff',\n border: `1px solid ${themeColors[8]}`,\n color: themeColors[8],\n marginTop: '16px',\n marginBottom: 0,\n }}\n />\n </div>\n )}\n\n <div\n // biome-ignore lint/security/noDangerouslySetInnerHtml: values are escaped by parseEmailHtml\n dangerouslySetInnerHTML={{ __html: parse(data.bodyTwo) }}\n />\n </EmailContainer>\n );\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vrplatform/email",
3
- "version": "1.0.2-stage.44636953783",
3
+ "version": "1.0.2-stage.44762129353",
4
4
  "description": "VRTrust transactional email templates and Postmark transport",
5
5
  "license": "ISC",
6
6
  "main": "build/main/index.js",
@@ -128,6 +128,8 @@ export const OwnerStatementEmailTemplate = ({
128
128
  details: string[];
129
129
  /** Opens the payment page. */
130
130
  payHref?: string;
131
+ /** How the owner can pay on the payment page. */
132
+ methods?: ('ach' | 'card')[];
131
133
  };
132
134
  }) => {
133
135
  const parse = (html: string) =>
@@ -295,7 +297,11 @@ export const OwnerStatementEmailTemplate = ({
295
297
  style={{ marginTop: '20px', marginBottom: '12px' }}
296
298
  />
297
299
  <Text style={{ color: mutedColor, fontSize: 12, margin: 0 }}>
298
- Bank transfer (ACH), secured by Stripe
300
+ {!payment.methods?.includes('card')
301
+ ? 'Bank transfer (ACH), secured by Stripe'
302
+ : payment.methods.includes('ach')
303
+ ? 'Bank transfer (ACH) or card, secured by Stripe'
304
+ : 'Card, secured by Stripe'}
299
305
  </Text>
300
306
  </>
301
307
  )}