Openstatus www.openstatus.dev
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: add monitor deactivation

authored by

Maximilian Kaske and committed by
Maximilian Kaske
7b6d3e5f 06ee3d9c

+68
+68
packages/emails/emails/monitor-deactivation.tsx
··· 1 + /** @jsxImportSource react */ 2 + 3 + import { 4 + Body, 5 + Button, 6 + Head, 7 + Heading, 8 + Html, 9 + Preview, 10 + Text, 11 + } from "@react-email/components"; 12 + import { z } from "zod"; 13 + import { Layout } from "./_components/layout"; 14 + import { styles } from "./_components/styles"; 15 + 16 + export const MonitorDeactivationSchema = z.object({ 17 + lastLogin: z.coerce.date(), 18 + deactivateAt: z.coerce.date(), 19 + reminder: z.boolean().optional(), 20 + }); 21 + 22 + export type MonitorDeactivationProps = z.infer< 23 + typeof MonitorDeactivationSchema 24 + >; 25 + 26 + const MonitorDeactivationEmail = ({ 27 + lastLogin, 28 + deactivateAt, 29 + reminder, 30 + }: MonitorDeactivationProps) => { 31 + return ( 32 + <Html> 33 + <Head /> 34 + <Preview> 35 + {reminder ? "[REMINDER] " : ""}Deactivation of your monitor(s) 36 + </Preview> 37 + <Body style={styles.main}> 38 + <Layout> 39 + <Heading as="h3">Deactivation of the your monitor(s)</Heading> 40 + <Text>Your last login was {lastLogin.toDateString()}.</Text> 41 + <Text> 42 + To avoid having stale monitors and reduce the number of testing 43 + accounts, we will deactivate your monitor(s) at{" "} 44 + {deactivateAt.toDateString()}. 45 + </Text> 46 + <Text> 47 + If you would like to keep your monitor(s) active, please login to 48 + your account or upgrade your plan. 49 + </Text> 50 + <Text style={{ textAlign: "center" }}> 51 + <Button style={styles.button} href="https://.openstatus.dev/app"> 52 + Login 53 + </Button> 54 + </Text> 55 + </Layout> 56 + </Body> 57 + </Html> 58 + ); 59 + }; 60 + 61 + MonitorDeactivationEmail.PreviewProps = { 62 + lastLogin: new Date(new Date().setDate(new Date().getDate() - 100)), 63 + deactivateAt: new Date(new Date().setDate(new Date().getDate() + 7)), 64 + reminder: true, 65 + } satisfies MonitorDeactivationProps; 66 + 67 + export { MonitorDeactivationEmail }; 68 + export default MonitorDeactivationEmail;