| 1 | import { Section, Text } from '@react-email/components' |
| 2 | import { env } |
| 3 | import { |
| 4 | ActionButton, |
| 5 | EmailLayout, |
| 6 | InfoCard, |
| 7 | InfoRow, |
| 8 | text, |
| 9 | } from '../components/layout' |
| 10 | |
| 11 | const baseUrl = env |
| 12 | |
| 13 | interface InvoiceSentEmailProps { |
| 14 | currency: string |
| 15 | dueDate: string |
| 16 | invoiceId: string |
| 17 | invoiceNumber: string |
| 18 | issueDate: string |
| 19 | orgSlug: string |
| 20 | projectName: string |
| 21 | projectSlug: string |
| 22 | recipientName: string |
| 23 | senderName: string |
| 24 | totalAmount: string |
| 25 | } |
| 26 | |
| 27 | export default function InvoiceSentEmail |
| 28 | recipientName = 'Jane Smith' |
| 29 | invoiceNumber = 'INV-2026-001' |
| 30 | projectName = 'Website Redesign' |
| 31 | senderName = 'John Doe' |
| 32 | totalAmount = '2,500.00' |
| 33 | currency = 'USD' |
| 34 | dueDate = 'March 30, 2026' |
| 35 | issueDate = 'March 8, 2026' |
| 36 | orgSlug = 'acme' |
| 37 | projectSlug = 'website-redesign' |
| 38 | invoiceId = 'inv_abc123' |
| 39 | }: InvoiceSentEmailProps) |
| 40 | return ( |
| 41 | <EmailLayout |
| 42 | accentColor='#7c3aed' |
| 43 | heading='You have a new invoice' |
| 44 | preview={`Invoice ${invoiceNumber |
| 45 | > |
| 46 | <Text style={ |
| 47 | Hi {recipientName}, <span |
| 48 | you an invoice for work on{' '} |
| 49 | <span style={text |
| 50 | </Text> |
| 51 | <Section style={ |
| 52 | <Text style={ |
| 53 | <Text style={ |
| 54 | </Section> |
| 55 | <InfoCard> |
| 56 | <InfoRow label=' |
| 57 | <InfoRow label=' |
| 58 | <InfoRow label=' |
| 59 | </InfoCard> |
| 60 | <ActionButton |
| 61 | href={`${baseUrl |
| 62 | > |
| 63 | View Invoice |
| 64 | </ActionButton> |
| 65 | <Text style={ |
| 66 | If you have questions about this invoice, you can start a thread |
| 67 | directly on the invoice page. |
| 68 | </Text> |
| 69 | </EmailLayout> |
| 70 | ) |
| 71 | } |
| 72 | |
| 73 | const amountSection = { |
| 74 | textAlign: 'center' as |
| 75 | padding: '20px 0 8px', |
| 76 | } |
| 77 | |
| 78 | const currencyLabel = { |
| 79 | fontSize: '13px', |
| 80 | color: '#71717a', |
| 81 | fontWeight: '500' as |
| 82 | margin: '0 0 4px', |
| 83 | textAlign: 'center' as |
| 84 | } |