|
| 1 | +import { |
| 2 | + Body, |
| 3 | + Button, |
| 4 | + Container, |
| 5 | + Font, |
| 6 | + Heading, |
| 7 | + Html, |
| 8 | + Preview, |
| 9 | + Section, |
| 10 | + Tailwind, |
| 11 | + Text, |
| 12 | +} from '@react-email/components'; |
| 13 | +import { Footer } from '../components/footer'; |
| 14 | +import { Logo } from '../components/logo'; |
| 15 | + |
| 16 | +interface Props { |
| 17 | + organizationName: string; |
| 18 | + requesterName: string; |
| 19 | + requesterEmail: string; |
| 20 | + requesterCompany?: string | null; |
| 21 | + requesterJobTitle?: string | null; |
| 22 | + purpose?: string | null; |
| 23 | + requestedDurationDays?: number | null; |
| 24 | + reviewUrl: string; |
| 25 | +} |
| 26 | + |
| 27 | +export const AccessRequestNotificationEmail = ({ |
| 28 | + organizationName, |
| 29 | + requesterName, |
| 30 | + requesterEmail, |
| 31 | + requesterCompany, |
| 32 | + requesterJobTitle, |
| 33 | + purpose, |
| 34 | + requestedDurationDays, |
| 35 | + reviewUrl, |
| 36 | +}: Props) => { |
| 37 | + return ( |
| 38 | + <Html> |
| 39 | + <Tailwind> |
| 40 | + <head> |
| 41 | + <Font |
| 42 | + fontFamily="Geist" |
| 43 | + fallbackFontFamily="Helvetica" |
| 44 | + fontWeight={400} |
| 45 | + fontStyle="normal" |
| 46 | + /> |
| 47 | + <Font |
| 48 | + fontFamily="Geist" |
| 49 | + fallbackFontFamily="Helvetica" |
| 50 | + fontWeight={500} |
| 51 | + fontStyle="normal" |
| 52 | + /> |
| 53 | + </head> |
| 54 | + <Preview>New Trust Portal Access Request from {requesterName}</Preview> |
| 55 | + |
| 56 | + <Body className="mx-auto my-auto bg-[#fff] font-sans"> |
| 57 | + <Container |
| 58 | + className="mx-auto my-[40px] max-w-[600px] border-transparent p-[20px] md:border-[#E8E7E1]" |
| 59 | + style={{ borderStyle: 'solid', borderWidth: 1 }} |
| 60 | + > |
| 61 | + <Logo /> |
| 62 | + <Heading className="mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-[#121212]"> |
| 63 | + New Access Request |
| 64 | + </Heading> |
| 65 | + |
| 66 | + <Text className="text-[14px] leading-[24px] text-[#121212]"> |
| 67 | + A new request to access <strong>{organizationName}</strong>'s |
| 68 | + trust portal has been submitted and is awaiting your review. |
| 69 | + </Text> |
| 70 | + |
| 71 | + <Section |
| 72 | + className="mt-[20px] mb-[20px] rounded-[3px] p-[15px]" |
| 73 | + style={{ backgroundColor: '#f8f9fa' }} |
| 74 | + > |
| 75 | + <Text className="m-0 mb-[10px] text-[14px] font-semibold text-[#121212]"> |
| 76 | + Requester Details |
| 77 | + </Text> |
| 78 | + <Text className="m-0 text-[14px] leading-[20px] text-[#121212]"> |
| 79 | + <strong>Name:</strong> {requesterName} |
| 80 | + <br /> |
| 81 | + <strong>Email:</strong> {requesterEmail} |
| 82 | + {requesterCompany && ( |
| 83 | + <> |
| 84 | + <br /> |
| 85 | + <strong>Company:</strong> {requesterCompany} |
| 86 | + </> |
| 87 | + )} |
| 88 | + {requesterJobTitle && ( |
| 89 | + <> |
| 90 | + <br /> |
| 91 | + <strong>Job Title:</strong> {requesterJobTitle} |
| 92 | + </> |
| 93 | + )} |
| 94 | + </Text> |
| 95 | + </Section> |
| 96 | + |
| 97 | + {purpose && ( |
| 98 | + <Section className="mb-[20px]"> |
| 99 | + <Text className="m-0 mb-[8px] text-[14px] font-semibold text-[#121212]"> |
| 100 | + Purpose |
| 101 | + </Text> |
| 102 | + <Text className="m-0 text-[14px] leading-[20px] text-[#121212]"> |
| 103 | + {purpose} |
| 104 | + </Text> |
| 105 | + </Section> |
| 106 | + )} |
| 107 | + |
| 108 | + {requestedDurationDays && ( |
| 109 | + <Text className="text-[14px] leading-[24px] text-[#121212]"> |
| 110 | + <strong>Requested Access Duration:</strong>{' '} |
| 111 | + {requestedDurationDays} days |
| 112 | + </Text> |
| 113 | + )} |
| 114 | + |
| 115 | + <Section className="mt-[32px] mb-[32px] text-center"> |
| 116 | + <Button |
| 117 | + className="rounded-[3px] bg-[#121212] px-[20px] py-[12px] text-center text-[14px] font-semibold text-white no-underline" |
| 118 | + href={reviewUrl} |
| 119 | + > |
| 120 | + Review Request |
| 121 | + </Button> |
| 122 | + </Section> |
| 123 | + |
| 124 | + <Section |
| 125 | + className="mt-[30px] mb-[20px] rounded-[3px] border-l-4 p-[15px]" |
| 126 | + style={{ backgroundColor: '#fff4e6', borderColor: '#f59e0b' }} |
| 127 | + > |
| 128 | + <Text className="m-0 text-[14px] leading-[24px] text-[#121212]"> |
| 129 | + <strong>Action Required</strong> |
| 130 | + <br /> |
| 131 | + Please review this request and either approve or deny access. |
| 132 | + Approved requests will require the requester to sign an NDA |
| 133 | + before accessing your trust portal. |
| 134 | + </Text> |
| 135 | + </Section> |
| 136 | + |
| 137 | + <br /> |
| 138 | + |
| 139 | + <Footer /> |
| 140 | + </Container> |
| 141 | + </Body> |
| 142 | + </Tailwind> |
| 143 | + </Html> |
| 144 | + ); |
| 145 | +}; |
| 146 | + |
| 147 | +export default AccessRequestNotificationEmail; |
0 commit comments