🚀 Getting Started from Zero

Complete guide: Nothing → Sending beautiful emails in 15 minutes

Step 1
Copy Templates to Your Project
⏱️ 2 minutes

Clone or download the templates:

# Option A: Copy all templates
cp -r /path/to/email-templates/emails /your-project/

# Option B: Copy just one template
cp /path/to/email-templates/emails/01-welcome.tsx /your-project/emails/
✅ You now have 6 production-ready email templates
Step 2
Install Dependencies
⏱️ 1 minute
cd /your-project
npm install resend react-email @react-email/components react

What these do:

Step 3
Get Resend API Key
⏱️ 2 minutes
  1. Go to resend.com/signup
  2. Sign up (free - 3,000 emails/month)
  3. Create API key at resend.com/api-keys
  4. Copy the key (starts with re_)

Add to your .env file:

RESEND_API_KEY=re_your_key_here
Step 4
Send Your First Email
⏱️ 5 minutes

Create send-email.ts:

import { Resend } from 'resend';
import { WelcomeEmail } from './emails/01-welcome';

const resend = new Resend(process.env.RESEND_API_KEY);

async function sendWelcomeEmail() {
  const { data, error } = await resend.emails.send({
    from: 'onboarding@resend.dev', // Use this for testing
    to: 'your-email@example.com',   // YOUR email here!
    subject: 'Welcome to My App!',
    react: WelcomeEmail({
      userName: 'Test User',
      productName: 'My App',
      loginUrl: 'https://example.com/login'
    })
  });

  if (error) {
    console.error('Failed to send:', error);
    return;
  }

  console.log('Email sent!', data);
}

sendWelcomeEmail();

Run it:

npx tsx send-email.ts
# Or: npx ts-node send-email.ts
# Or: tsc send-email.ts && node send-email.js
✅ Check your inbox! You should see a beautiful welcome email.
Step 5
Use in Your App
⏱️ 5 minutes

Example: Next.js API route

// app/api/send-welcome/route.ts
import { Resend } from 'resend';
import { WelcomeEmail } from '@/emails/01-welcome';

const resend = new Resend(process.env.RESEND_API_KEY);

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

  const { data, error } = await resend.emails.send({
    from: 'hello@yourdomain.com',
    to: email,
    subject: 'Welcome!',
    react: WelcomeEmail({ userName: name })
  });

  if (error) {
    return Response.json({ error }, { status: 500 });
  }

  return Response.json({ success: true });
}

Example: Signup flow

async function handleSignup(email: string, name: string) {
  // 1. Create user
  const user = await db.users.create({ email, name });

  // 2. Send welcome email
  await resend.emails.send({
    from: 'hello@yourdomain.com',
    to: email,
    subject: 'Welcome!',
    react: WelcomeEmail({ userName: name })
  });

  return { success: true, user };
}

🎉 You're Done!

You can now send beautiful, professional emails in minutes.

← Back to Template Gallery
🔧 Troubleshooting

"Module not found: Can't resolve 'react'"

npm install react

"RESEND_API_KEY is not defined"

• Check .env file exists
• Load env vars: import 'dotenv/config'
• Or with Next.js, it's automatic

"from address not verified"

For testing: Use onboarding@resend.dev
For production: Add your domain in Resend dashboard

📚 What's Next?
  1. Try all 6 templates (password reset, receipt, notification, etc.)
  2. Customize the templates (change colors, text, props)
  3. Add your brand (logo, colors, fonts)
  4. Integrate into your app (signup, checkout, notifications)
  5. Monitor delivery in Resend dashboard
💡 Pro tip: Preview emails before sending with npm run dev in the email-templates directory. Opens preview server at localhost:3000.