| 1 | import { 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 InvitationEmailProps { |
| 14 | invitedByName: string |
| 15 | inviteLink: string |
| 16 | organizationName: string |
| 17 | role: string |
| 18 | } |
| 19 | |
| 20 | const roleLabelMap: Record |
| 21 | owner: 'Owner', |
| 22 | admin: 'Admin', |
| 23 | member: 'Team Member', |
| 24 | client: 'Stakeholder', |
| 25 | } |
| 26 | |
| 27 | export default function InvitationEmail |
| 28 | invitedByName = 'John Doe' |
| 29 | organizationName = 'Acme Studio' |
| 30 | role = 'member' |
| 31 | inviteLink = `${baseUrl |
| 32 | }: InvitationEmailProps) |
| 33 | const roleLabel = |
| 34 | |
| 35 | return ( |
| 36 | <EmailLayout |
| 37 | heading={`Join ${organizationName |
| 38 | preview={`${invitedByName |
| 39 | > |
| 40 | <Text style={ |
| 41 | <span style={text |
| 42 | collaborate on Saturn as a <span style={text |
| 43 | </Text> |
| 44 | <InfoCard> |
| 45 | <InfoRow label=' |
| 46 | <InfoRow label=' |
| 47 | </InfoCard> |
| 48 | <ActionButton href={ |
| 49 | <Text style={ |
| 50 | This invitation expires in 7 days. If you weren't expecting this, you |
| 51 | can safely ignore it. |
| 52 | </Text> |
| 53 | </EmailLayout> |
| 54 | ) |
| 55 | } |