Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit 4d4a89d

Browse files
HasithDeAlwisAashna-Verma
authored andcommitted
feat(emails): create register for hackathon email
1 parent 233fb75 commit 4d4a89d

File tree

2 files changed

+138
-81
lines changed

2 files changed

+138
-81
lines changed

apps/email/templates/cuhacking/registered-for-hackathon.tsx

Lines changed: 10 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -23,84 +23,15 @@ function getGenericEmailConstants() {
2323
* } */
2424
/* catch (error) {
2525
* console.error('Error fetching email content:', error) */
26-
return {
27-
title: 'Heeyy :333',
28-
body: {
29-
text: `Your application to the cuHacking 2025 event at Carleton University has been accepted! 🔥🔥🔥
30-
31-
Details ...
32-
📍 Richcraft Hall (1125 Colonel By Dr, Carleton University)
33-
⌛ March 14-16 (Check-in from 5pm - 9pm)
34-
35-
🥗 Food + Merch will be provided for the first 300 hackers on site!<br>
36-
What to bring?
37-
🪪 Government ID<
38-
💻 Your laptop + charger
39-
🛏️ Sleeping bags
40-
🪥 Personal hygiene (plz bring deodorant, plz ...)
41-
🥤 Reusable water bottle
42-
🤪 A positive attitude!`,
43-
44-
buttonText: 'JOIN DISCORD',
45-
buttonLink: 'https://discord.gg/VnbWdAe8kA',
46-
47-
secondButtonText: 'ADD TO CALENDAR',
48-
secondButtonLink: 'https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=MDY1bnFyb3B2c2Z1NjM4dDRxODcybmhtYWwgZmNkYmEzZjM1NGQ0ZTAxNTUyZTI0OTVkNzQzMTA1YmQ5ZWZjZTRlMTA3NmNkYTNjMWVjMTQ1NGQwZjVmYWE3M0Bn&tmsrc=fcdba3f354d4e01552e2495d743105bd9efce4e1076cda3c1ec1454d0f5faa73%40group.calendar.google.com',
49-
50-
events: [
51-
{
52-
title: 'Upcoming events...',
53-
},
54-
{
55-
title: 'Intro to QNX',
56-
text: 'Learn about QNX with 3 awesome speakers + meet some interns. Make sure you bring your laptop. Happening March 11th, 6:30 to 8:00 pm. Register now!',
57-
buttons: [
58-
{
59-
text: "REGISTER",
60-
link: "https://docs.google.com/forms/d/e/1FAIpQLSfni0BpF_2vf9xM02Ux4t979C_jVVXLvxVDv0u1hrrobVan-A/viewform"
61-
}
62-
]
63-
},
64-
{
65-
title: "Learn about Gadget",
66-
text: "Gadget is hosting a Q&A webinar to teach students the basics of their platform. It's happening Wednesday, March 12th at 2:30pm. You must create an account using the link below. If you already have an account let Gadget know during the webinar.",
67-
buttons: [
68-
{
69-
text: "CREATE ACCOUNT",
70-
link: "https://app.gadget.dev/auth/login?returnTo=/auth/hackathon"
71-
},
72-
{
73-
text: "WEBINAR",
74-
link: "https://meet.google.com/ybk-wumk-hig"
75-
}
76-
]
77-
},
78-
{
79-
title: "Resume Roast",
80-
text: "Get your resume roasted at cuHacking! Sign up below to be eligible. Brought to you by uO SESA",
81-
buttons: [
82-
{
83-
text: "REGISTER",
84-
link: "https://docs.google.com/forms/d/e/1FAIpQLSdljqp8Z6F6ADINhJergvcqJZ6aTYSW2SSSVrngsY6ltx1eHQ/viewform"
85-
}
86-
]
26+
return {
27+
title: 'Your account is created.',
28+
body: {
29+
buttonText: 'Complete Registration',
30+
buttonLink: 'https://portal.cuhacking.ca/terms',
31+
text: 'Looking forward to seeing you on March 14th!',
32+
footer: 'See you soon!',
8733
},
88-
{
89-
title: "Sign up for our portal!",
90-
text: "Create your account on our portal! You must do this to be eligible for our hackathon",
91-
buttons: [
92-
{
93-
text: "CREATE ACCOUNT",
94-
link: "https://portal.cuhacking.ca"
95-
}
96-
]
97-
}
98-
],
99-
},
100-
}
101-
102-
103-
34+
}
10435
/* } */
10536
}
10637

@@ -125,8 +56,6 @@ const genericEmailConstants = getGenericEmailConstants()
12556
)
12657
}
12758

128-
export default function Preview() {
129-
return (
130-
<Generic {...genericEmailConstants} />
131-
)
59+
export default function RegisteredForHackathon() {
60+
return <Generic {...genericEmailConstants} />
13261
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
/* import { execSync } from 'node:child_process' */
2+
import { Banner, Content, Footer, Keyboard } from '@/email/components'
3+
/* import { render } from "@react-email/render"; */
4+
import { Container, Html, Section, Tailwind } from '@react-email/components'
5+
6+
function getGenericEmailConstants() {
7+
/* try {
8+
* const response = execSync(
9+
* `curl -s ${process.env.CUHACKING_2025_AXIOM_LOCAL_URL}/api/emails/1?depth=1`,
10+
* ).toString()
11+
12+
* const { title = 'No Title', body = {} } = JSON.parse(response)
13+
14+
* return {
15+
* title,
16+
* body: {
17+
* text: body.text || 'No body text provided.',
18+
* buttonText: body.buttonText || '',
19+
* buttonLink: body.buttonLink || '',
20+
* footer: body.footer || '',
21+
* },
22+
* }
23+
* } */
24+
/* catch (error) {
25+
* console.error('Error fetching email content:', error) */
26+
27+
return {
28+
title: 'Heeyy :333',
29+
body: {
30+
text: `You're registered for cuHacking 2025 at Carleton University! 🔥🔥🔥
31+
32+
Details ...
33+
34+
📍 Richcraft Hall (1125 Colonel By Dr, Carleton University)
35+
⌛ March 14-16 (Check-in from 5pm - 9pm)
36+
37+
🥗 Food + Merch will be provided for the first 300 hackers on site!<br>
38+
What to bring?
39+
🪪 Government ID
40+
💻 Your laptop + charger
41+
🛏 Sleeping bags
42+
🪥 Personal hygiene (plz bring deodorant, plz ...)
43+
🥤 Reusable water bottle
44+
🤪 A positive attitude!`,
45+
46+
buttonText: 'JOIN DISCORD',
47+
buttonLink: 'https://discord.gg/VnbWdAe8kA',
48+
49+
secondButtonText: 'ADD TO CALENDAR',
50+
secondButtonLink: 'https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=MDY1bnFyb3B2c2Z1NjM4dDRxODcybmhtYWwgZmNkYmEzZjM1NGQ0ZTAxNTUyZTI0OTVkNzQzMTA1YmQ5ZWZjZTRlMTA3NmNkYTNjMWVjMTQ1NGQwZjVmYWE3M0Bn&tmsrc=fcdba3f354d4e01552e2495d743105bd9efce4e1076cda3c1ec1454d0f5faa73%40group.calendar.google.com',
51+
52+
events: [
53+
{
54+
title: 'Upcoming events...',
55+
},
56+
{
57+
title: 'Intro to QNX',
58+
text: 'Learn about QNX with 3 awesome speakers + meet some interns. Make sure you bring your laptop. Happening March 11th, 6:30 to 8:00 pm. Register now!',
59+
buttons: [
60+
{
61+
text: "REGISTER",
62+
link: "https://docs.google.com/forms/d/e/1FAIpQLSfni0BpF_2vf9xM02Ux4t979C_jVVXLvxVDv0u1hrrobVan-A/viewform"
63+
}
64+
]
65+
},
66+
{
67+
title: "Learn about Gadget",
68+
text: "Gadget is hosting a Q&A webinar to teach students the basics of their platform. It's happening Wednesday, March 12th at 2:30pm. You must create an account using the link below. If you already have an account let Gadget know during the webinar.",
69+
buttons: [
70+
{
71+
text: "CREATE ACCOUNT",
72+
link: "https://app.gadget.dev/auth/login?returnTo=/auth/hackathon"
73+
},
74+
{
75+
text: "WEBINAR",
76+
link: "https://meet.google.com/ybk-wumk-hig"
77+
}
78+
]
79+
},
80+
{
81+
title: "Resume Roast",
82+
text: "Get your resume roasted at cuHacking! Sign up below to be eligible. Brought to you by uO SESA",
83+
buttons: [
84+
{
85+
text: "REGISTER",
86+
link: "https://docs.google.com/forms/d/e/1FAIpQLSdljqp8Z6F6ADINhJergvcqJZ6aTYSW2SSSVrngsY6ltx1eHQ/viewform"
87+
}
88+
]
89+
},
90+
{
91+
title: "Sign up for our portal!",
92+
text: "Create your account on our portal! You must do this to be eligible for our hackathon",
93+
buttons: [
94+
{
95+
text: "CREATE ACCOUNT",
96+
link: "https://portal.cuhacking.ca"
97+
}
98+
]
99+
}
100+
],
101+
},
102+
}
103+
}
104+
105+
const genericEmailConstants = getGenericEmailConstants()
106+
107+
function Generic({ title, body } : { title: string, body: string }) {
108+
return (
109+
<Tailwind>
110+
<Html>
111+
<Container className="w-full max-w-[600px] mx-auto bg-black rounded-t-md">
112+
<Section className="text-center">
113+
<Banner />
114+
<Content title={title} body={body} />
115+
<Keyboard />
116+
<Footer />
117+
</Section>
118+
</Container>
119+
</Html>
120+
</Tailwind>
121+
)
122+
}
123+
124+
export default function Preview() {
125+
return (
126+
<Generic {...genericEmailConstants} />
127+
)
128+
}

0 commit comments

Comments
 (0)