From 152f42780cb429bada7a501bea2d0c6d302518d1 Mon Sep 17 00:00:00 2001 From: cehune Date: Tue, 22 Oct 2024 01:17:22 +0000 Subject: [PATCH] Add email template for file expiry --- emails/file_expiry.tsx | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 emails/file_expiry.tsx diff --git a/emails/file_expiry.tsx b/emails/file_expiry.tsx new file mode 100644 index 0000000..2a6d6a4 --- /dev/null +++ b/emails/file_expiry.tsx @@ -0,0 +1,70 @@ +import { + Hr, + Link, + Section, + Text +} from "@react-email/components"; +import { z } from "zod"; +import { WATcloudEmail } from "./_common/watcloud-email"; + +const WATcloudOnboardingEmailProps = z.object({ + name: z.string(), + machines: z.array(z.string()), + paths: z.array(z.array(z.string())), + daysForExpiry: z.string(), + deletionDate: z.string() +}); + +type WATcloudOnboardingEmailProps = z.infer; + +export const WATcloudOnboardingEmail = (props: WATcloudOnboardingEmailProps) => { + const { name, machines, paths, daysForExpiry, deletionDate} = WATcloudOnboardingEmailProps.parse(props); + + const previewText = `Welcome to WATcloud! Your access has been updated.`; + const expiredPaths = ( +
+ {machines.map((machine, index) => ( +
    +
  • {machine}
  • +
      + {paths[index]?.map((path, pathIndex) => ( +
    • {path}
    • + ))} +
    +
+ ))} +
+ ) + + return ( + + Hi {name}, + + As per efforts to clean up WATO's file drives, we're looking to delete directories that haven't been used in {daysForExpiry} days. + +
+
+ The following paths on each respective machine are expired: + {expiredPaths} +
+
+ + If you do not use or access any of these directories, then they will be automatically deleted on {deletionDate}. + + + If you have any questions, please reach out to your WATcloud contact or the WATcloud team at infra-outreach@watonomous.ca. + +
+ ); +}; + +WATcloudOnboardingEmail.PreviewProps = { + name: "John Doe", + services: ["Compute Cluster", "Discord", "Google Workspace"], + machines: ["delta-ubuntu2", "tr-ubuntu3"], + paths: [["home/john/watcloud-emails", "home/john/temp"], ["home/john/temp2"]], + daysForExpiry: "70", + deletionDate: "2025-01-01" +} as WATcloudOnboardingEmailProps; + +export default WATcloudOnboardingEmail; \ No newline at end of file