| 1 | import { Section, Text } from '@react-email/components' |
| 2 | import { env } |
| 3 | import { |
| 4 | ActionButton, |
| 5 | Badge, |
| 6 | EmailLayout, |
| 7 | InfoCard, |
| 8 | InfoRow, |
| 9 | text, |
| 10 | } from '../components/layout' |
| 11 | |
| 12 | const baseUrl = env |
| 13 | |
| 14 | interface ExpenseSubmittedEmailProps { |
| 15 | amount: string |
| 16 | billable: boolean |
| 17 | category: string |
| 18 | expenseDate: string |
| 19 | memberName: string |
| 20 | orgSlug: string |
| 21 | projectName: string |
| 22 | projectSlug: string |
| 23 | recipientName: string |
| 24 | title: string |
| 25 | } |
| 26 | |
| 27 | export default function ExpenseSubmittedEmail |
| 28 | recipientName = 'John Doe' |
| 29 | memberName = 'Jane Smith' |
| 30 | projectName = 'Website Redesign' |
| 31 | title = 'Adobe Creative Cloud monthly subscription' |
| 32 | amount = '$49.99' |
| 33 | category = 'Software' |
| 34 | expenseDate = 'Mar 10, 2026' |
| 35 | billable = true, |
| 36 | orgSlug = 'acme' |
| 37 | projectSlug = 'website-redesign' |
| 38 | }: ExpenseSubmittedEmailProps) |
| 39 | return ( |
| 40 | <EmailLayout |
| 41 | accentColor='#7c3aed' |
| 42 | heading='Expense submitted for review' |
| 43 | preview={`${memberName |
| 44 | > |
| 45 | <Text style={ |
| 46 | Hi {recipientName}, <span |
| 47 | submitted an expense for <span style={text |
| 48 | that needs your approval. |
| 49 | </Text> |
| 50 | <Section style={ |
| 51 | <Text style={ |
| 52 | <Text style={ |
| 53 | </Section> |
| 54 | <InfoCard> |
| 55 | <InfoRow label=' |
| 56 | <InfoRow label=' |
| 57 | <InfoRow label=' |
| 58 | <InfoRow label=' |
| 59 | <InfoRow |
| 60 | label='Billable' |
| 61 | value={ |
| 62 | <Badge color={ |
| 63 | {billable ? 'Yes |
| 64 | </Badge> |
| 65 | } |
| 66 | /> |
| 67 | </InfoCard> |
| 68 | <ActionButton href={ |
| 69 | Review Expense |
| 70 | </ActionButton> |
| 71 | </EmailLayout> |
| 72 | ) |
| 73 | } |
| 74 | |
| 75 | const amountSection = { |
| 76 | textAlign: 'center' as |
| 77 | padding: '20px 0 8px', |
| 78 | } |
| 79 | |
| 80 | const amountLabel = { |
| 81 | fontSize: '13px', |
| 82 | color: '#71717a', |
| 83 | fontWeight: '500' as |
| 84 | margin: '0 0 4px', |
| 85 | textAlign: 'center' as |
| 86 | textTransform: 'uppercase' as |
| 87 | letterSpacing: '0.5px', |
| 88 | } |