| 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 ExpenseApprovedEmailProps { |
| 15 | amount: string |
| 16 | approverName: string |
| 17 | billable: boolean |
| 18 | category: string |
| 19 | expenseDate: string |
| 20 | orgSlug: string |
| 21 | projectName: string |
| 22 | projectSlug: string |
| 23 | recipientName: string |
| 24 | title: string |
| 25 | } |
| 26 | |
| 27 | export default function ExpenseApprovedEmail |
| 28 | recipientName = 'Jane Smith' |
| 29 | approverName = 'John Doe' |
| 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 | }: ExpenseApprovedEmailProps) |
| 39 | return ( |
| 40 | <EmailLayout |
| 41 | accentColor='#16a34a' |
| 42 | heading='Expense approved' |
| 43 | preview={`Your expense for ${projectName |
| 44 | > |
| 45 | <Text style={ |
| 46 | Hi {recipientName}, <span |
| 47 | approved your expense for <span style={text |
| 48 | . |
| 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 |
| 59 | label='Billable' |
| 60 | value={ |
| 61 | <Badge color={ |
| 62 | {billable ? 'Yes |
| 63 | </Badge> |
| 64 | } |
| 65 | /> |
| 66 | </InfoCard> |
| 67 | <ActionButton |
| 68 | color='#16a34a' |
| 69 | href={`${baseUrl |
| 70 | > |
| 71 | View Expense |
| 72 | </ActionButton> |
| 73 | </EmailLayout> |
| 74 | ) |
| 75 | } |
| 76 | |
| 77 | const amountSection = { |
| 78 | textAlign: 'center' as |
| 79 | padding: '20px 0 8px', |
| 80 | } |
| 81 | |
| 82 | const amountLabel = { |
| 83 | fontSize: '13px', |
| 84 | color: '#71717a', |
| 85 | fontWeight: '500' as |
| 86 | margin: '0 0 4px', |
| 87 | textAlign: 'center' as |
| 88 | textTransform: 'uppercase' as |
| 89 | letterSpacing: '0.5px', |
| 90 | } |