|
| 1 | +import { |
| 2 | + Body, |
| 3 | + Container, |
| 4 | + Font, |
| 5 | + Heading, |
| 6 | + Html, |
| 7 | + Preview, |
| 8 | + Section, |
| 9 | + Tailwind, |
| 10 | + Text, |
| 11 | +} from '@react-email/components'; |
| 12 | +import { Footer } from '../components/footer'; |
| 13 | +import { Logo } from '../components/logo'; |
| 14 | + |
| 15 | +interface Props { |
| 16 | + email: string; |
| 17 | + userName: string; |
| 18 | + organizationName: string; |
| 19 | + completedAt: Date; |
| 20 | +} |
| 21 | + |
| 22 | +export const TrainingCompletedEmail = ({ |
| 23 | + email, |
| 24 | + userName, |
| 25 | + organizationName, |
| 26 | + completedAt, |
| 27 | +}: Props) => { |
| 28 | + const formattedDate = new Date(completedAt).toLocaleDateString('en-US', { |
| 29 | + year: 'numeric', |
| 30 | + month: 'long', |
| 31 | + day: 'numeric', |
| 32 | + }); |
| 33 | + |
| 34 | + return ( |
| 35 | + <Html> |
| 36 | + <Tailwind> |
| 37 | + <head> |
| 38 | + <Font |
| 39 | + fontFamily="Geist" |
| 40 | + fallbackFontFamily="Helvetica" |
| 41 | + fontWeight={400} |
| 42 | + fontStyle="normal" |
| 43 | + /> |
| 44 | + <Font |
| 45 | + fontFamily="Geist" |
| 46 | + fallbackFontFamily="Helvetica" |
| 47 | + fontWeight={500} |
| 48 | + fontStyle="normal" |
| 49 | + /> |
| 50 | + </head> |
| 51 | + <Preview> |
| 52 | + Congratulations! You've completed your Security Awareness Training |
| 53 | + </Preview> |
| 54 | + |
| 55 | + <Body className="mx-auto my-auto bg-[#fff] font-sans"> |
| 56 | + <Container |
| 57 | + className="mx-auto my-[40px] max-w-[600px] border-transparent p-[20px] md:border-[#E8E7E1]" |
| 58 | + style={{ borderStyle: 'solid', borderWidth: 1 }} |
| 59 | + > |
| 60 | + <Logo /> |
| 61 | + <Heading className="mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-[#121212]"> |
| 62 | + Training Complete! |
| 63 | + </Heading> |
| 64 | + |
| 65 | + <Text className="text-[14px] leading-[24px] text-[#121212]"> |
| 66 | + Hi {userName}, |
| 67 | + </Text> |
| 68 | + |
| 69 | + <Text className="text-[14px] leading-[24px] text-[#121212]"> |
| 70 | + Congratulations! You have successfully completed all Security |
| 71 | + Awareness Training modules for <strong>{organizationName}</strong> |
| 72 | + . |
| 73 | + </Text> |
| 74 | + |
| 75 | + <Section |
| 76 | + className="mt-[24px] mb-[24px] rounded-[8px] p-[24px] text-center" |
| 77 | + style={{ backgroundColor: '#f0fdf4', border: '1px solid #bbf7d0' }} |
| 78 | + > |
| 79 | + <Text className="m-0 text-[16px] font-medium text-[#166534]"> |
| 80 | + Completion Date: {formattedDate} |
| 81 | + </Text> |
| 82 | + </Section> |
| 83 | + |
| 84 | + <Text className="text-[14px] leading-[24px] text-[#121212]"> |
| 85 | + Your training completion certificate is attached to this email. |
| 86 | + Please save it for your records. |
| 87 | + </Text> |
| 88 | + |
| 89 | + <Text className="text-[14px] leading-[24px] text-[#121212]"> |
| 90 | + Thank you for your commitment to maintaining security awareness |
| 91 | + and helping protect {organizationName}. |
| 92 | + </Text> |
| 93 | + |
| 94 | + <br /> |
| 95 | + <Section> |
| 96 | + <Text className="text-[12px] leading-[24px] text-[#666666]"> |
| 97 | + This notification was intended for{' '} |
| 98 | + <span className="text-[#121212]">{email}</span>. |
| 99 | + </Text> |
| 100 | + </Section> |
| 101 | + |
| 102 | + <br /> |
| 103 | + |
| 104 | + <Footer /> |
| 105 | + </Container> |
| 106 | + </Body> |
| 107 | + </Tailwind> |
| 108 | + </Html> |
| 109 | + ); |
| 110 | +}; |
| 111 | + |
| 112 | +export default TrainingCompletedEmail; |
0 commit comments