diff --git a/docs/components/Footer.tsx b/docs/components/Footer.tsx index 2c3d2a6601821..31e9af2556a3d 100644 --- a/docs/components/Footer.tsx +++ b/docs/components/Footer.tsx @@ -172,7 +172,6 @@ function SubmitForm() { }) .then((res) => res.json()) .then((res) => { - Cookies.set("ckId", res.id, { expires: 365 }); return router.push("/confirm"); }); e.preventDefault(); diff --git a/docs/components/pages/confirm.tsx b/docs/components/pages/confirm.tsx index 44d9467a71d7d..17d9c6e212e71 100644 --- a/docs/components/pages/confirm.tsx +++ b/docs/components/pages/confirm.tsx @@ -1,13 +1,8 @@ /* eslint-disable react/no-unescaped-entities */ -import axios from "axios"; import Head from "next/head"; import { Container } from "../Container"; -import { Radio, RadioGroup } from "../RadioGroup"; -import { useCkViewer } from "../useCkViewer"; export default function Confirm() { - const { data, mutate } = useCkViewer(); - return ( <> @@ -19,65 +14,18 @@ export default function Confirm() {
- {data && data?.fields?.job_title ? ( -
-

- Thanks so much! There's one last step. -

-

- - Please confirm your email. - {" "} - Please check your inbox for an email that just got sent. - You'll need to click the confirmation link to receive any - further emails. -

{" "} -

- If you don't see the email after a few minutes, you might - check your spam folder or other filters and add{" "} - - hello@turborepo.org - {" "} - to your contacts. -

-

- Thanks, -
- The Turborepo Team -

-
- ) : ( -
-
- How would you describe yourself? -
- - Choose one: - - } - onChange={(job_title) => { - axios - .put(`/api/user/${data.id}`, { - ...data, - fields: { - ...data.fields, - job_title, - }, - }) - .then(() => mutate(`/api/user/${data.id}`, true)) - .catch((err) => console.log(err)); - }} - > - Engineering Manager - Senior Developer - Junior Developer - Novice Developer - Choose not to say - -
- )} +
+

Thanks so much!

+

+ Keep an eye on your inbox for product updates and + announcements from Turborepo and Vercel. +

{" "} +

+ Thanks, +
+ The Turborepo Team +

+
diff --git a/docs/pages/api/signup.tsx b/docs/pages/api/signup.tsx index d32954d71b5a4..8faa69f8c447e 100644 --- a/docs/pages/api/signup.tsx +++ b/docs/pages/api/signup.tsx @@ -1,23 +1,32 @@ import { NextApiRequest, NextApiResponse } from "next"; -import { subscribeToForm } from "../../lib/ConvertKitApi"; -const FORM_ID = process.env.CONVERTKIT_FORM_ID; +const CAMPAIGN_ID = process.env.TURBOREPO_SFDC_CAMPAIGN_ID; +const TRAY_URL = process.env.TRAY_URL; export default async function handle( req: NextApiRequest, res: NextApiResponse ) { if (req.method === "POST") { - const subscriber = await subscribeToForm({ - formId: FORM_ID, + const user = { email: req.body.email, - firstName: req.body.firstName, - fields: { - last_name: req.body.lastName, - }, - }); + campaign_id: CAMPAIGN_ID, + }; - return res.status(201).json(subscriber); + try { + const trayRes = await fetch(TRAY_URL, { + method: "POST", + headers: { + "Content-Type": "application/json", + Accept: "application/json", + }, + body: JSON.stringify({ user: user }), + }); + + return res.status(201).json(user); + } catch (error) { + return res.status(500).json(error); + } } else { return res.status(404).send(null); }