From 7738197819060362d8f6b5d09b2c4d7af81e844e Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Mon, 30 Dec 2024 21:41:58 -0800 Subject: [PATCH] Add account renewal email (#23) This PR adds an account renewal email: image --- emails/account-renewal.tsx | 132 +++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 emails/account-renewal.tsx diff --git a/emails/account-renewal.tsx b/emails/account-renewal.tsx new file mode 100644 index 0000000..df442ba --- /dev/null +++ b/emails/account-renewal.tsx @@ -0,0 +1,132 @@ +import { + Heading, + Hr, + Img, + Link, + Markdown, + Text +} from "@react-email/components"; +import { z } from "zod"; +import { WATcloudEmail } from "./_common/watcloud-email"; + +const EmailProps = z.object({ + name: z.string(), + lastActiveTerm: z.string(), + expiresOn: z.string(), + daysUntilExpiry: z.number(), + renewalLink: z.string(), + expiryLink: z.string(), + expiryDetails: z.string(), + targetEmails: z.array(z.string()), +}); + +type EmailProps = z.infer; + +export function Email(props: EmailProps) { + const { + name, + lastActiveTerm, + expiresOn, + daysUntilExpiry, + renewalLink, + expiryLink, + expiryDetails, + targetEmails + } = EmailProps.parse(props); + + const previewText = `Reminder: ${name}, your WATcloud access expires on ${expiresOn} (in ${daysUntilExpiry} days)`; + + return ( + + Hi {name}, + + We wanted to remind you that your access to WATcloud will expire on + {expiresOn} (in {daysUntilExpiry} days). + + + Your last active term was {lastActiveTerm}. To renew your access, please update your selection for "Active Terms" at this link. + + + You may receive additional reminders as the expiry date approaches. + If you would like to revoke your access earlier, please submit this prepopulated form. + + + + On expiry, your services will be affected as follows: + +
+ {expiryDetails} +
+ + This email is intended for {targetEmails.join(" and ")}. If you have received this email in error, please contact us at infra-outreach@watonomous.ca. + +
+ ); +}; + +Email.PreviewProps = { + name: "John Doe", + lastActiveTerm: "2024 Fall (2024-09-01 to 2024-12-31)", + expiresOn: "2025-01-31", + daysUntilExpiry: 30, + renewalLink: "https://example.com/renew", + expiryLink: "https://example.com/expire", + expiryDetails: ` +**Azure (WATonomous)** + +Your access to the Azure organization will be removed. + + +**Compute Cluster** + +Your access to the compute cluster will be disabled and the following data will be deleted: +- Home directory (shared between all machines): \`/home/johndoe\` +- Container directory (on each login node): \`/var/lib/cluster/users/1234\` + +Data stored in shared directories such as \`/scratch\` and \`/mnt/wato-drive*\` under your account may be deleted in the future when we perform routine maintenance on the cluster. + + +**Discord (WATonomous)** + +The following roles will be removed from your Discord account on the WATonomous server: +- Core Member +- WATcloud +- Admin + +The following roles will be added: +- Alumni + + +**GitHub (WATonomous)** + +Your access to the GitHub organization will be removed. + + +**Google Workspace (WATonomous)** + +No changes will be made to your Google Workspace account. You will still have access to your email, calendar, and other Google Workspace services. + + +**Grafana (WATonomous)** + +Your access to the Grafana instance will be removed. + + +**WATcloud Internal Tools** + +Your access to WATcloud internal tools will be disabled. + + +**Sentry (WATonomous)** + +Your access to the Sentry organization will be removed. + + +**WATcloud Public Profile** + +No changes will be made to your WATcloud public profile. + `, + targetEmails: ["john.doe@example.com", "john.doe2@example2.com"], +} as EmailProps; + +export default Email;