Back

Email Integration Guide

Connect your waitlist to popular email services and automate your workflow

TutorialIntegration

Email Integration Guide

Learn how to integrate your waitlist with popular email service providers to automate your communication workflow.

Setting Up Email Notifications

First, configure your environment variables. Create a .env.local file with your email service credentials.

Sending Welcome Emails

Here's how to send a welcome email when someone joins your waitlist:

// lib/email.ts
import { Resend } from 'resend'

const resend = new Resend(process.env.EMAIL_SERVICE_API_KEY)

export async function sendWelcomeEmail(email: string, position: number) {
  try {
    await resend.emails.send({
      from: process.env.EMAIL_FROM!,
      to: email,
      subject: 'Welcome to our waitlist!',
      html: `
        <h1>You're on the list!</h1>
        <p>Thanks for joining. You're #${position} in line.</p>
        <p>We'll notify you when it's your turn!</p>
      `,
    })
  } catch (error) {
    console.error('Failed to send email:', error)
  }
}

Handling Form Submissions

Integrate the email service with your waitlist form:

// app/api/waitlist/route.ts
import { sendWelcomeEmail } from '@/lib/email'
import { NextResponse } from 'next/server'

export async function POST(request: Request) {
  const { email } = await request.json()

  // Add to database
  const position = await addToWaitlist(email)

  // Send welcome email
  await sendWelcomeEmail(email, position)

  return NextResponse.json({
    success: true,
    position,
  })
}

Email Templates

Create reusable email templates for better maintainability:

// components/emails/welcome.tsx
interface WelcomeEmailProps {
  position: number
  firstName?: string
}

export function WelcomeEmail({ position, firstName }: WelcomeEmailProps) {
  return (
    <div>
      <h1>Welcome{firstName ? `, ${firstName}` : ''}!</h1>
      <p>You're #{position} on our waitlist.</p>
      <a href="https://yourdomain.com/verify">Verify your email</a>
    </div>
  )
}

Best Practices

  • Always validate email addresses before sending
  • Use email verification to prevent spam
  • Include an unsubscribe link in every email
  • Monitor your email deliverability rates
  • A/B test different subject lines

Start building better email workflows today!

Limited Access

Build Your Waitlist

Create beautiful, high-converting waitlist pages in minutes. Join thousands already on the list.

Get Early Access

Read more

Custom Styling Your Autonomous Business Services

Transform your Services-as-Software into unique brand experiences with semantic patterns and the .do platform

Getting Started with Waitlist.do

Learn how to set up your first waitlist in minutes

Analytics & Tracking Setup

Track conversions and optimize your waitlist performance with analytics