@vrplatform/email 1.0.2-stage.44505332089 → 1.0.2-stage.44572108860

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.
@@ -29,11 +29,12 @@ export declare const OwnerStatementEmailTemplate: ({ data, tenant, themeColors,
29
29
  listings?: string;
30
30
  };
31
31
  /**
32
- * The owner payment block: what is due with the pay button, a payment
33
- * received, or a payment that failed.
32
+ * The owner payment block: what is due with the pay button, a reserve
33
+ * top-up due when the balance end is not negative, a payment received, or a
34
+ * payment that failed.
34
35
  */
35
36
  payment?: {
36
- kind: 'due' | 'received' | 'failed';
37
+ kind: 'due' | 'reserveTopUp' | 'received' | 'failed';
37
38
  /** Formatted amount, such as `$1,284.50`. */
38
39
  amount: string;
39
40
  /** Short lines under the amount, such as `Please pay by Oct 16, 2026`. */
@@ -57,6 +57,7 @@ const mutedColor = '#737373';
57
57
  const borderColor = '#e5e7eb';
58
58
  const paymentColors = {
59
59
  due: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },
60
+ reserveTopUp: { background: '#eff6ff', border: '#bfdbfe', text: '#1e40af' },
60
61
  failed: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },
61
62
  received: { background: '#f0fdf4', border: '#bbf7d0', text: '#166534' },
62
63
  };
@@ -114,9 +115,11 @@ const OwnerStatementEmailTemplate = ({ data, tenant, themeColors, mode, user, li
114
115
  margin: 0,
115
116
  }, children: payment.kind === 'due'
116
117
  ? 'Balance due'
117
- : payment.kind === 'received'
118
- ? 'Payment received'
119
- : 'Payment failed' }), (0, jsx_runtime_1.jsx)(text_1.Text, { style: {
118
+ : payment.kind === 'reserveTopUp'
119
+ ? 'Reserve top-up due'
120
+ : payment.kind === 'received'
121
+ ? 'Payment received'
122
+ : 'Payment failed' }), (0, jsx_runtime_1.jsx)(text_1.Text, { style: {
120
123
  color: paymentColors[payment.kind].text,
121
124
  fontSize: 32,
122
125
  fontWeight: 700,
@@ -128,7 +131,9 @@ const OwnerStatementEmailTemplate = ({ data, tenant, themeColors, mode, user, li
128
131
  margin: '4px 0 0',
129
132
  }, children: detail }, detail))), payment.payHref && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { href: payment.payHref, mode: mode, "data-testid": "pay-owner-balance-button", label: payment.kind === 'failed'
130
133
  ? 'Pay again'
131
- : '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: {
134
+ : payment.kind === 'reserveTopUp'
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: {
132
137
  marginTop: '24px',
133
138
  marginBottom: '32px',
134
139
  ...(payment?.payHref && {
@@ -1 +1 @@
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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AI,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;AAnQW,QAAA,2BAA2B,GAA3B,2BAA2B,CAmQtC","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 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 payment\n * received, or a payment that failed.\n */\n payment?: {\n kind: 'due' | '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 === '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 : '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,IA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AC,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"]}
@@ -29,11 +29,12 @@ export declare const OwnerStatementEmailTemplate: ({ data, tenant, themeColors,
29
29
  listings?: string;
30
30
  };
31
31
  /**
32
- * The owner payment block: what is due with the pay button, a payment
33
- * received, or a payment that failed.
32
+ * The owner payment block: what is due with the pay button, a reserve
33
+ * top-up due when the balance end is not negative, a payment received, or a
34
+ * payment that failed.
34
35
  */
35
36
  payment?: {
36
- kind: 'due' | 'received' | 'failed';
37
+ kind: 'due' | 'reserveTopUp' | 'received' | 'failed';
37
38
  /** Formatted amount, such as `$1,284.50`. */
38
39
  amount: string;
39
40
  /** Short lines under the amount, such as `Please pay by Oct 16, 2026`. */
@@ -52,6 +52,7 @@ const mutedColor = '#737373';
52
52
  const borderColor = '#e5e7eb';
53
53
  const paymentColors = {
54
54
  due: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },
55
+ reserveTopUp: { background: '#eff6ff', border: '#bfdbfe', text: '#1e40af' },
55
56
  failed: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },
56
57
  received: { background: '#f0fdf4', border: '#bbf7d0', text: '#166534' },
57
58
  };
@@ -109,9 +110,11 @@ export const OwnerStatementEmailTemplate = ({ data, tenant, themeColors, mode, u
109
110
  margin: 0,
110
111
  }, children: payment.kind === 'due'
111
112
  ? 'Balance due'
112
- : payment.kind === 'received'
113
- ? 'Payment received'
114
- : 'Payment failed' }), _jsx(Text, { style: {
113
+ : payment.kind === 'reserveTopUp'
114
+ ? 'Reserve top-up due'
115
+ : payment.kind === 'received'
116
+ ? 'Payment received'
117
+ : 'Payment failed' }), _jsx(Text, { style: {
115
118
  color: paymentColors[payment.kind].text,
116
119
  fontSize: 32,
117
120
  fontWeight: 700,
@@ -123,7 +126,9 @@ export const OwnerStatementEmailTemplate = ({ data, tenant, themeColors, mode, u
123
126
  margin: '4px 0 0',
124
127
  }, children: detail }, detail))), payment.payHref && (_jsxs(_Fragment, { children: [_jsx(Button, { href: payment.payHref, mode: mode, "data-testid": "pay-owner-balance-button", label: payment.kind === 'failed'
125
128
  ? 'Pay again'
126
- : '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: {
129
+ : payment.kind === 'reserveTopUp'
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: {
127
132
  marginTop: '24px',
128
133
  marginBottom: '32px',
129
134
  ...(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,MAAM,WAAW,GACf,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAC9D,MAAM,KAAK,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC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,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 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 payment\n * received, or a payment that failed.\n */\n payment?: {\n kind: 'due' | '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 === '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 : '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,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,MAAM,WAAW,GACf,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAC9D,MAAM,KAAK,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,oBAA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AAW,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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vrplatform/email",
3
- "version": "1.0.2-stage.44505332089",
3
+ "version": "1.0.2-stage.44572108860",
4
4
  "description": "VRTrust transactional email templates and Postmark transport",
5
5
  "license": "ISC",
6
6
  "main": "build/main/index.js",
@@ -90,6 +90,7 @@ const mutedColor = '#737373';
90
90
  const borderColor = '#e5e7eb';
91
91
  const paymentColors = {
92
92
  due: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },
93
+ reserveTopUp: { background: '#eff6ff', border: '#bfdbfe', text: '#1e40af' },
93
94
  failed: { background: '#fef2f2', border: '#fecaca', text: '#991b1b' },
94
95
  received: { background: '#f0fdf4', border: '#bbf7d0', text: '#166534' },
95
96
  };
@@ -115,11 +116,12 @@ export const OwnerStatementEmailTemplate = ({
115
116
  */
116
117
  yearEnd?: { listings?: string };
117
118
  /**
118
- * The owner payment block: what is due with the pay button, a payment
119
- * received, or a payment that failed.
119
+ * The owner payment block: what is due with the pay button, a reserve
120
+ * top-up due when the balance end is not negative, a payment received, or a
121
+ * payment that failed.
120
122
  */
121
123
  payment?: {
122
- kind: 'due' | 'received' | 'failed';
124
+ kind: 'due' | 'reserveTopUp' | 'received' | 'failed';
123
125
  /** Formatted amount, such as `$1,284.50`. */
124
126
  amount: string;
125
127
  /** Short lines under the amount, such as `Please pay by Oct 16, 2026`. */
@@ -247,9 +249,11 @@ export const OwnerStatementEmailTemplate = ({
247
249
  >
248
250
  {payment.kind === 'due'
249
251
  ? 'Balance due'
250
- : payment.kind === 'received'
251
- ? 'Payment received'
252
- : 'Payment failed'}
252
+ : payment.kind === 'reserveTopUp'
253
+ ? 'Reserve top-up due'
254
+ : payment.kind === 'received'
255
+ ? 'Payment received'
256
+ : 'Payment failed'}
253
257
  </Text>
254
258
  <Text
255
259
  style={{
@@ -283,7 +287,9 @@ export const OwnerStatementEmailTemplate = ({
283
287
  label={
284
288
  payment.kind === 'failed'
285
289
  ? 'Pay again'
286
- : 'Pay Deficit Balance'
290
+ : payment.kind === 'reserveTopUp'
291
+ ? 'Pay balance'
292
+ : 'Pay Deficit Balance'
287
293
  }
288
294
  themeColors={themeColors}
289
295
  style={{ marginTop: '20px', marginBottom: '12px' }}