Files
acmcc/supabase/functions/_shared/transactional-email-templates/vendor-profile-request.tsx
T
admin 393268dd04 Vendor profile email: add where-to-send-invoices block
Below the Submit vendor profile button, instruct vendors to email bills to
ap@avriacam.com or mail them to the association's mailing address, c/o Avria
Community Management, LLC. The address is resolved from the vendor's
association (association_id, falling back to association_ids[0]).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 12:20:12 -04:00

81 lines
4.1 KiB
TypeScript

import * as React from 'npm:react@18.3.1'
import { Body, Button, Container, Head, Heading, Html, Preview, Section, Text } from 'npm:@react-email/components@0.0.22'
import type { TemplateEntry } from './registry.ts'
interface VendorProfileRequestProps {
vendorName?: string
requesterName?: string
link?: string
expiresAt?: string
associationName?: string
billingAddress?: string
}
const SITE_NAME = 'Avria Community Management'
const AP_EMAIL = 'ap@avriacam.com'
const VendorProfileRequestEmail = ({ vendorName, requesterName, link, expiresAt, associationName, billingAddress }: VendorProfileRequestProps) => (
<Html lang="en" dir="ltr">
<Head />
<Preview>Vendor profile information requested for {vendorName || 'your account'}</Preview>
<Body style={main}>
<Container style={container}>
<Section style={brandBar} />
<Heading style={h1}>Vendor profile update requested</Heading>
<Text style={text}>Hello {vendorName || 'Vendor'},</Text>
<Text style={text}>
{requesterName || SITE_NAME} is requesting that you submit or update your vendor profile.
Please use the secure link below to provide your remittance address, Tax ID (W-9 / 1099 status),
insurance documentation, and direct deposit (ACH) details.
</Text>
{link && <Button href={link} style={button}>Submit vendor profile</Button>}
{expiresAt && <Text style={meta}>This secure link expires on {expiresAt}.</Text>}
<Section style={billingBox}>
<Text style={billingHeading}>Where to send your invoices</Text>
<Text style={billingText}>
Please email all invoices and bills to{' '}
<a href={`mailto:${AP_EMAIL}`} style={emailLink}>{AP_EMAIL}</a>, or mail them to:
</Text>
<Text style={addressText}>
{[associationName, 'c/o Avria Community Management, LLC', billingAddress]
.filter(Boolean)
.join('\n')}
</Text>
</Section>
<Text style={footer}>
This request was sent by {SITE_NAME}. If you weren't expecting it, you can ignore this email.
</Text>
</Container>
</Body>
</Html>
)
export const template = {
component: VendorProfileRequestEmail,
subject: (data: Record<string, any>) =>
`Action needed: Submit vendor profile for ${data.vendorName || 'your account'}`,
displayName: 'Vendor profile request',
previewData: {
vendorName: 'Acme Plumbing',
requesterName: 'Avria Community Management',
link: 'https://avria.cloud/vendor-profile/sample-token',
expiresAt: 'June 1, 2026',
associationName: 'Village Woods of La Cita Homeowners Association, Inc.',
billingAddress: 'P.O. Box 560099\nRockledge, FL 32956',
},
} satisfies TemplateEntry
const main = { backgroundColor: '#ffffff', fontFamily: 'Inter, Arial, sans-serif' }
const container = { maxWidth: '600px', margin: '0 auto', padding: '28px 24px' }
const brandBar = { height: '5px', backgroundColor: '#2563eb', borderRadius: '6px', marginBottom: '24px' }
const h1 = { color: '#111827', fontSize: '24px', lineHeight: '32px', margin: '0 0 14px', fontWeight: '700' }
const text = { color: '#374151', fontSize: '15px', lineHeight: '24px', margin: '0 0 18px' }
const meta = { color: '#6b7280', fontSize: '13px', lineHeight: '20px', margin: '14px 0 0' }
const button = { backgroundColor: '#2563eb', color: '#ffffff', borderRadius: '6px', fontSize: '14px', fontWeight: '600', textDecoration: 'none', padding: '12px 18px' }
const footer = { color: '#6b7280', fontSize: '12px', lineHeight: '18px', margin: '28px 0 0' }
const billingBox = { backgroundColor: '#f9fafb', border: '1px solid #e5e7eb', borderRadius: '8px', padding: '16px 18px', margin: '26px 0 0' }
const billingHeading = { color: '#111827', fontSize: '15px', lineHeight: '22px', fontWeight: '700', margin: '0 0 8px' }
const billingText = { color: '#374151', fontSize: '14px', lineHeight: '22px', margin: '0 0 10px' }
const emailLink = { color: '#2563eb', textDecoration: 'underline' }
const addressText = { color: '#111827', fontSize: '14px', lineHeight: '22px', margin: '0', whiteSpace: 'pre-line' as const, fontWeight: '600' }