Deploy to Vercel
yodaNOTION_SECRET, NOTION_DB, RESEND_API_KEY, UPSTASH_REDIS_REST_URL, and UPSTASH_REDIS_REST_TOKEN).repository·yoda·Indexed 43 days ago
https://github.com/lakshaybhushan/nextjs-notion-waitlist-templateA Next.js 14 template for building waitlist pages using Notion as a CMS, Upstash Redis for rate limiting, and Resend for automated email notifications. Version 1.5.0 includes the NotionWaitlistEmail React Email component and a cn utility for merging Tailwind CSS classes.
NOTION_SECRET, NOTION_DB, RESEND_API_KEY, UPSTASH_REDIS_REST_URL, and UPSTASH_REDIS_REST_TOKEN).Resend is used to send confirmation emails to users who join the waitlist.
RESEND_API_KEY.To run the project locally, fork the repository, clone it, and follow these steps. This project uses bun as the package manager.
bun install.env.local file in the root directory and populate it with the required environment variables.bun devbun emailbun install
bun dev
bun emailTo use Notion as your waitlist database, follow these steps:
Name: Type TitleEmail: Type EmailNOTION_SECRET.https://www.notion.so/{DATABASE_ID}?v={NUMBERS}Upstash Redis is used to rate limit signups.
REST URL and the TOKEN from your Upstash dashboard to use in your environment variables.The following environment variables must be provided for the template to function. You can use .env.example as a reference for local development or provide them during Vercel deployment.
NOTION_SECRET
NOTION_DB
RESEND_API_KEY
UPSTASH_REDIS_REST_URL
UPSTASH_REDIS_REST_TOKENThe NotionWaitlistEmail component accepts the following props:
| Prop | Type | Description |
|---|---|---|
userFirstname | string | The first name of the user to be used in the greeting and the email preview text. |
The cn function is a utility used to conditionally merge Tailwind CSS classes and resolve conflicts between them. It combines clsx (for conditional class logic) and tailwind-merge (to ensure the last class in the list wins when there are Tailwind conflicts, such as p-4 vs p-2).
Use this function whenever you need to apply dynamic or conditional styles to a component while ensuring Tailwind CSS class precedence is handled correctly.
import { cn } from '@/lib/utils';
// Example usage:
const className = cn('text-red-500', isActive && 'font-bold', 'p-4 p-2');
// Result will correctly resolve Tailwind conflicts (e.g., p-2 will override p-4)The NotionWaitlistEmail component is a React Email template used to send waitlist notification emails via Resend. It accepts a userFirstname prop to personalize the greeting and the email preview text.
To use it, import the component and pass the user's first name as a prop. This component is built using @react-email/components.
import { NotionWaitlistEmail } from './emails';
// Example usage in a Resend sending function
const emailHtml = render(<NotionWaitlistEmail userFirstname="Tyler" />);