Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Get this from your Discord channel: Edit Channel → Integrations → Webhooks
DISCORD_WEBHOOK_URL=
COLOCATION_RESERVATION_DISCORD_WEBHOOK=
OFFICE_SIGNUP_DISCORD_WEBHOOK=

# Autumn payments keys. Webhooks are in beta as of 04/04/2025, so you have to contact them to use it.
AUTUMN_SECRET_KEY=
Expand Down
13 changes: 12 additions & 1 deletion src/lib/components/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
import { Icon } from '@steeze-ui/svelte-icon';
import { ChevronDown, Close, Menu } from '@steeze-ui/carbon-icons';

type InternalHref = '/' | '/about' | '/services/vps' | '/services/colocation' | '/docs'; // can we just use sveltekit resolve here
type InternalHref =
| '/'
| '/about'
| '/our-office'
| '/services/vps'
| '/services/colocation'
| '/docs'; // can we just use sveltekit resolve here

let isMobileMenuOpen = $state(false);
let openDropdown = $state<string | null>(null);
Expand All @@ -28,6 +34,11 @@
description: "Why we're building this.",
href: '/about' as InternalHref
},
{
label: 'Our Office',
description: 'Work alongside us in Ravenswood.',
href: '/our-office' as InternalHref
},
{
label: 'Documentation',
description: 'What to expect when using Stack.',
Expand Down
47 changes: 47 additions & 0 deletions src/routes/our-office/+page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { fail } from '@sveltejs/kit';
import { env } from '$env/dynamic/private';
import type { Actions } from './$types';

export const actions: Actions = {
signup: async ({ request }) => {
const webhookUrl = env.OFFICE_SIGNUP_DISCORD_WEBHOOK;
if (!webhookUrl) {
return fail(500, { error: 'Office signup is not configured.' });
}
const data = await request.formData();

const name = String(data.get('name') ?? '').trim();
const email = String(data.get('email') ?? '').trim();
const membership = String(data.get('membership') ?? '').trim();
const note = String(data.get('note') ?? '').trim();

if (!name || !email) {
return fail(400, { error: 'Name and email are required.', name, email, membership, note });
}

const res = await fetch(webhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
embeds: [
{
title: 'New office membership inquiry',
color: 0xc6716d,
fields: [
{ name: 'Name', value: name, inline: true },
{ name: 'Email', value: email, inline: true },
{ name: 'Membership', value: membership || 'Not specified', inline: true },
...(note ? [{ name: 'Note', value: note }] : [])
]
}
]
})
});

if (!res.ok) {
return fail(500, { error: 'Something went wrong. Email us directly at hello@fyrastack.com.', name, email, membership, note });
}

return { success: true };
}
};
Loading
Loading