Back to Documentation
Email System Guide

Email System Documentation

Comprehensive guide to setting up and using the multi-provider email system with analytics and templates.

Email System Overview

This SaaS starter kit includes a comprehensive email system that supports multiple providers, email analytics, template management, and automated email sequences.

Multi-Provider

Support for Resend, SMTP, Brevo, and Postmark with automatic failover

Analytics

Real-time email tracking, delivery rates, opens, clicks, and performance metrics

Templates

Template management with variables, categories, and admin interface

Setup Wizard (Recommended)
The easiest way to configure your email system during initial setup.
The setup wizard at /setup includes a dedicated email configuration step that automatically configures providers, environment variables, and default templates.

Wizard Features:

Choose from 4 email providers (Resend, SMTP, Brevo, Postmark)
Automatic environment variable configuration
Default email templates creation
Email analytics and features toggle
Start Setup Wizard
Supported Email Providers
Resend (Recommended)

Modern transactional email service with excellent deliverability.

Easy setup and configuration
Excellent deliverability rates
Built-in analytics
RESEND_API_KEY="re_your_api_key"
SMTP

Traditional SMTP server support for any email provider.

Universal compatibility
Use any SMTP provider
Gmail, Outlook support
SMTP_HOST="smtp.gmail.com"
Brevo

Formerly Sendinblue, offers marketing and transactional emails.

Marketing + transactional
Advanced automation
Comprehensive analytics
BREVO_API_KEY="xkeysib_your_key"
Postmark

Reliable transactional email with high deliverability.

High deliverability
Detailed tracking
Enterprise features
POSTMARK_SERVER_TOKEN="your_token"
Email Analytics & Tracking

The email system includes comprehensive analytics to track email performance and user engagement.

Delivery Rate

Track successful email deliveries

Open Rate

Monitor email open percentages

Click Rate

Track link clicks and engagement

Performance

Compare template effectiveness

Access email analytics at /admin/email-analytics after setup. The dashboard supports both light and dark themes with real-time data.
Email Template Management

Manage email templates with variables, categories, and admin interface for easy customization.

Default Templates

Welcome Email

Sent to new users upon registration

Variables: app_name, user_name

Password Reset

Secure password reset emails

Variables: app_name, user_name, reset_link

Template Categories

onboarding
security
marketing
billing
system
Manage templates at /admin/email-templates. Create new templates, edit existing ones, and organize by categories.
Usage Example

Here's how to send emails programmatically using the email service:

import { sendEmail } from '@/lib/email-service'; // Send a welcome email await sendEmail({ to: 'user@example.com', template: 'welcome', variables: { app_name: 'My SaaS App', user_name: 'John Doe' } }); // Send a password reset email await sendEmail({ to: 'user@example.com', template: 'password-reset', variables: { app_name: 'My SaaS App', user_name: 'John Doe', reset_link: 'https://myapp.com/reset?token=abc123' } });
Next Steps

Setup Email System

Use the setup wizard to configure email providers

Configure Billing

Set up Stripe for subscription management