-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format for file deletion as per file expiry project ![image](https://github.com/user-attachments/assets/58b5c66b-6c42-4348-ac50-3b4df5a26339)
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { | ||
Hr, | ||
Link, | ||
Section, | ||
Text | ||
} from "@react-email/components"; | ||
import { z } from "zod"; | ||
import { WATcloudEmail } from "./_common/watcloud-email"; | ||
|
||
const EmailProps = z.object({ | ||
name: z.string(), | ||
paths: z.array(z.string()), | ||
daysForExpiry: z.string() | ||
}); | ||
|
||
type EmailProps = z.infer<typeof EmailProps>; | ||
|
||
const Email = (props: EmailProps) => { | ||
const { name, paths, daysForExpiry } = EmailProps.parse(props); | ||
|
||
const previewText = `Some of your files in the WATcloud compute cluster have been deleted.`; | ||
|
||
const deletedPaths = ( | ||
<div> | ||
<ul style={{ fontSize: "14px", lineHeight: "24px" }}> | ||
{paths.map(path => ( | ||
<li key={path}>{path}</li> | ||
))} | ||
</ul> | ||
</div> | ||
); | ||
|
||
return ( | ||
<WATcloudEmail previewText={previewText}> | ||
<Text>Hi {name},</Text> | ||
<Text> | ||
In an ongoing effort to keep WATcloud's file storage efficient and maintain optimal performance, we routinely clean up specific directories that haven't been accessed in the past {daysForExpiry} days. We previously sent an email that you had files which met this criteria. Since they were not accessed by the given deadline, those files have been deleted. | ||
</Text> | ||
<Hr /> | ||
<Section> | ||
<Text>The following paths were deleted:</Text> | ||
{deletedPaths} | ||
</Section> | ||
<Hr /> | ||
<Text> | ||
If you have any questions, please reach out to your <Link href="https://cloud.watonomous.ca/docs/services#watcloud-contact" style={{ color: "#1e90ff", textDecoration: "none" }}>WATcloud contact</Link> or the WATcloud team at <Link href={`mailto:infra-outreach@watonomous.ca`} style={{ color: "#1e90ff", textDecoration: "none" }}>infra-outreach@watonomous.ca</Link>. | ||
</Text> | ||
</WATcloudEmail> | ||
); | ||
}; | ||
|
||
Email.PreviewProps = { | ||
name: "John Doe", | ||
paths: ["delta-ubuntu2:/var/lib/cluster/users/1234/docker", "delta-ubuntu2:/var/lib/cluster/users/1234/containers", "tr-ubuntu3:/var/lib/cluster/users/1234/containers", "/mnt/wato-drive2/someuser"], | ||
daysForExpiry: "70" | ||
} as EmailProps; | ||
|
||
export default Email; |