The waitlist feature uses a server action to handle form submissions it first checks if the email is already in the database and then adds it to the database and sends an email to the user.
When you’re ready to launch, you can export your waitlist data for use in email marketing tools:
Copy
// Script to export waitlist to CSVimport { db } from "@/lib/db";import * as fs from "fs";async function exportWaitlist() { const waitlistEntries = await db.waitlist.findMany(); const csv = waitlistEntries.map(entry => entry.email).join("\n"); fs.writeFileSync("waitlist.csv", csv); console.log(`Exported ${waitlistEntries.length} email addresses to waitlist.csv`);}exportWaitlist();