|
| 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