diff --git a/app/(api)/_actions/emails/emailTemplates/forgotPasswordTemplate.ts b/app/(api)/_actions/emails/emailTemplates/forgotPasswordTemplate.ts new file mode 100644 index 00000000..590c84dc --- /dev/null +++ b/app/(api)/_actions/emails/emailTemplates/forgotPasswordTemplate.ts @@ -0,0 +1,50 @@ +export default function forgotPasswordTemplate(link: string) { + const HEADER_IMAGE_URL = `${process.env.BASE_URL}/email/2025_email_header.png`; + return ` + + + + + + + Reset your HackDavis Hub Password + + + +
+ HackDavis 2025 header +

+ Reset your HackDavis Hub Password +

+
+
+

Click the link below to reset your password for the HackDavis Hub. This link expires in 24 hours. Do NOT share this link with anyone.

+

${link}

+

If you didn't request to reset your password, you can safely ignore this email.

+
+
+ + + `; +} diff --git a/app/(api)/_actions/emails/emailTemplates/hubEmergencyInviteTemplate.ts b/app/(api)/_actions/emails/emailTemplates/hubEmergencyInviteTemplate.ts new file mode 100644 index 00000000..83d4e28e --- /dev/null +++ b/app/(api)/_actions/emails/emailTemplates/hubEmergencyInviteTemplate.ts @@ -0,0 +1,49 @@ +export default function hubEmergencyInviteTemplate(link: string) { + const HEADER_IMAGE_URL = `${process.env.BASE_URL}/email/2025_email_header.png`; + return ` + + + + + + HackDavis Hub Invite Link + + + +
+ HackDavis 2025 header +

+ Invitation to the + HackDavis Hub +

+
+
+

Click the link below to create your account on the HackDavis Hub. Do NOT share this unique invite link with anyone.

+

${link}

+
+
+ + + `; +} diff --git a/app/(api)/_actions/invite/emailMessage.ts b/app/(api)/_actions/invite/emailMessage.ts index bfce8333..9202e4c9 100644 --- a/app/(api)/_actions/invite/emailMessage.ts +++ b/app/(api)/_actions/invite/emailMessage.ts @@ -1,162 +1,8 @@ -export default function emailMessage(type: string, link: string) { - const inviteMsg = ` - - - - HackDavis Hub Invite Link - - - -
-

Invitation to the HackDavis Hub

-

- Click the button below to create your account on the HackDavis Hub. This link expires in 14 days. Do NOT share this unique invite link with anyone. -

- Register -
-

If you're having trouble with the above button, copy and paste the following link into your browser:

- -
-
- - - `; - - const resetMsg = ` - - - - HackDavis Hub Reset Password Link - - - -
-

Reset Password Link for the HackDavis Hub

-

- Click the button below to reset your password for the HackDavis Hub. This link expires in 24 hours. Do NOT share this link with anyone. If you didn't request a password reset, you can safely ignore this email. -

- Reset Password -
-

If you're having trouble with the above button, copy and paste the following link into your browser:

- -
-
- - - `; - - return type === 'invite' ? inviteMsg : resetMsg; +export default function emailMessage(type: string, link: string) { + return type === 'invite' + ? hubEmergencyInviteTemplate(link) + : forgotPasswordTemplate(link); } diff --git a/app/(pages)/admin/_components/InviteLinkForm/InviteLinkForm.tsx b/app/(pages)/admin/_components/InviteLinkForm/InviteLinkForm.tsx index 7fa5376a..81259b06 100644 --- a/app/(pages)/admin/_components/InviteLinkForm/InviteLinkForm.tsx +++ b/app/(pages)/admin/_components/InviteLinkForm/InviteLinkForm.tsx @@ -47,7 +47,7 @@ export default function InviteLinkForm() { return ( <>
-

Invite a User [to be deprecated & replaced]

+

Invite a User

{error}

diff --git a/app/(pages)/admin/invite-hackers/page.tsx b/app/(pages)/admin/emergency-invites/page.tsx similarity index 100% rename from app/(pages)/admin/invite-hackers/page.tsx rename to app/(pages)/admin/emergency-invites/page.tsx diff --git a/app/(pages)/admin/page.tsx b/app/(pages)/admin/page.tsx index cb69ab44..dba3f7e2 100644 --- a/app/(pages)/admin/page.tsx +++ b/app/(pages)/admin/page.tsx @@ -26,8 +26,8 @@ const action_links = [ body: 'Invites', }, { - href: '/admin/invite-hackers', - body: 'Invite Hackers', + href: '/admin/emergency-invites', + body: 'Emergency Invites (hackers & judges)', }, { href: '/admin/randomize-projects',