Skip to content

Commit 7baa751

Browse files
committed
First pass at adding an enterprise page
1 parent 5b86fa9 commit 7baa751

File tree

6 files changed

+849
-5
lines changed

6 files changed

+849
-5
lines changed

packages/console/app/src/component/header.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export function Header(props: { zen?: boolean }) {
3636
<li>
3737
<a href="/docs">Docs</a>
3838
</li>
39+
<li>
40+
<A href="/enterprise">Enterprise</A>
41+
</li>
3942
<li>
4043
<Switch>
4144
<Match when={props.zen}>
@@ -107,6 +110,9 @@ export function Header(props: { zen?: boolean }) {
107110
<li>
108111
<a href="/docs">Docs</a>
109112
</li>
113+
<li>
114+
<A href="/enterprise">Enterprise</A>
115+
</li>
110116
<li>
111117
<Switch>
112118
<Match when={props.zen}>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import type { APIEvent } from "@solidjs/start/server"
2+
import { AWS } from "@opencode-ai/console-core/aws.js"
3+
4+
interface EnterpriseFormData {
5+
name: string
6+
company: string
7+
role: string
8+
email: string
9+
message: string
10+
}
11+
12+
export async function POST(event: APIEvent) {
13+
try {
14+
const body = (await event.request.json()) as EnterpriseFormData
15+
16+
// Validate required fields
17+
if (!body.name || !body.company || !body.role || !body.email || !body.message) {
18+
return Response.json({ error: "All fields are required" }, { status: 400 })
19+
}
20+
21+
// Validate email format
22+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
23+
if (!emailRegex.test(body.email)) {
24+
return Response.json({ error: "Invalid email format" }, { status: 400 })
25+
}
26+
27+
// Create email content
28+
const emailContent = `
29+
New Enterprise Inquiry
30+
31+
Name: ${body.name}
32+
Company: ${body.company}
33+
Role: ${body.role}
34+
Email: ${body.email}
35+
36+
Message:
37+
${body.message}
38+
`.trim()
39+
40+
// Send email using AWS SES
41+
await AWS.sendEmail({
42+
43+
subject: `Enterprise Inquiry from ${body.company}`,
44+
body: emailContent,
45+
})
46+
47+
return Response.json({ success: true, message: "Form submitted successfully" }, { status: 200 })
48+
} catch (error) {
49+
console.error("Error processing enterprise form:", error)
50+
return Response.json({ error: "Internal server error" }, { status: 500 })
51+
}
52+
}

0 commit comments

Comments
 (0)