Videa Docs

Email System

Transactional emails via Resend.

Overview

Videa uses Resend for transactional emails. All email logic is in lib/email.ts.

Email Types

EmailTriggerTemplate
VerificationUser registrationemails/verification-email.tsx
Password ResetForgot password requestemails/reset-password-email.tsx
WelcomeAfter email verificationInline
Purchase ConfirmationPayment webhookInline
Subscription ExpiryDays before expiryInline
Low Credits AlertBalance below thresholdInline

Configuration

RESEND_API_KEY="re_your_api_key"
RESEND_FROM_EMAIL="Videa <noreply@yourdomain.com>"

Development Mode

In development without a verified domain, Resend uses onboarding@resend.dev as the sender. You'll see this in your console logs.

Production

For production, verify your domain in the Resend dashboard and set RESEND_FROM_EMAIL to use your verified domain.

Email Templates

Templates use React Email components in the emails/ directory:

// emails/verification-email.tsx
import { Html, Body, Text, Link } from '@react-email/components';

export default function VerificationEmail({ url }: { url: string }) {
  return (
    <Html>
      <Body>
        <Text>Click below to verify your email:</Text>
        <Link href={url}>Verify Email</Link>
      </Body>
    </Html>
  );
}

Error Handling

All email sends are wrapped in try-catch. Failed sends are logged but don't crash the application. The system returns a success/error tuple instead of throwing:

const [success, error] = await sendVerificationEmail(email, token);

On this page