Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email template for file expiry #18

Merged
merged 2 commits into from
Oct 27, 2024
Merged

Add email template for file expiry #18

merged 2 commits into from
Oct 27, 2024

Conversation

cehune
Copy link
Contributor

@cehune cehune commented Oct 22, 2024

Need a unique email template for sending file expiry related emails.
Lists the expired emails from each machine

Tested using the cli to generate emails and it gives output as expected.

image

emails/file_expiry.tsx Outdated Show resolved Hide resolved
emails/file_expiry.tsx Outdated Show resolved Hide resolved
emails/file_expiry.tsx Outdated Show resolved Hide resolved
emails/file_expiry.tsx Outdated Show resolved Hide resolved
emails/file_expiry.tsx Outdated Show resolved Hide resolved
emails/file_expiry.tsx Outdated Show resolved Hide resolved
Copy link
Member

@ben-z ben-z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good after the changes!

@@ -11,7 +11,7 @@ import { getAsset, registerAsset, WATcloudURI } from "../../utils/watcloud-uri";
registerAsset('watcloud-logo', new WATcloudURI("watcloud://v1/sha256:393767e36d5387815c15d11c506c3c820de5db41723ffc062751673621dedb15?name=1024x512%20black%401x.png"))

// Wrapper for WATcloud-themed emails
export function WATcloudEmail({
export function Email({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export function Email({
export function WATcloudEmail({

Oh we should keep this as-is. I was talking about the per-email function names.


type EmailProps = z.infer<typeof EmailProps>;

export const FileExpiryEmail = (props: EmailProps) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be called email, because we don't use it externally anyway.

Suggested change
export const FileExpiryEmail = (props: EmailProps) => {
const Email = (props: EmailProps) => {

const { name, paths, daysForExpiry, deletionDate} = EmailProps.parse(props);

const previewText = `You have expired files in the WATO drives`;
const mapPathToMachine = (): Record<string, string[]> => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we can just keep this simple and just list the strings, don't need to group by machine. But that's up to you.

@cehune cehune merged commit 8740170 into main Oct 27, 2024
1 check passed
@cehune cehune deleted the file-expiry branch October 27, 2024 01:39
@cehune
Copy link
Contributor Author

cehune commented Oct 27, 2024

DIDN"T MEAN TO MERGE!

cehune added a commit that referenced this pull request Oct 28, 2024
Add custom email type for notifying users when their files expire


![image](https://github.com/user-attachments/assets/39c1ff8d-13ec-417c-b884-9be5330852e5)

Continuation of #18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants