Email Technical Details

This document provides technical details about the Email feature, primarily for developers or for advanced configuration after deployment.

Configuration

The email module is configured in nuxt.config.ts. It supports multiple providers, queuing, rate limiting, and analytics.

Example configuration:

export default defineNuxtConfig({
  emailModule: {
    defaultFrom: 'info@example.com',
    defaultFromName: 'Your Company',
    providers: {
      primary: 'aws-ses', // Options: 'aws-ses', 'resend'
      fallback: 'resend',
    },
    queue: {
      enabled: true,
      batchSize: 50,
      cronSchedule: '* * * * *',
      maxRetries: 3,
    },
    rateLimit: {
      enabled: true,
      awsSes: { perMinute: 14 },
      resend: { perMinute: 10 },
    },
    analytics: {
      enabled: true,
      trackOpens: true,
      trackClicks: true,
    },
  },
})

Email Templates

Templates are Vue components located in the app/emails directory. This allows for dynamic content generation using Vue's template syntax.

Developer Note: Templates are created using code (Vue components), not a visual drag-and-drop editor. You can preview your coded templates in the admin panel, but creating or modifying the design requires developer intervention.

Example app/emails/welcome.vue:

<template>
  <e-html>
    <e-head />
    <e-body>
      <e-container>
        <e-heading>Welcome, {{ name }}!</e-heading>
        <e-text>Thanks for signing up.</e-text>
      </e-container>
    </e-body>
  </e-html>
</template>

<script setup>
defineProps({
  name: String,
})
</script>

Programmatic Sending

Emails are sent using the useEmail composable.

const { send } = useEmail()

await send({
  to: 'user@example.com',
  subject: 'Welcome!',
  template: 'welcome',
  props: {
    name: 'John Doe',
  },
})

Note: The module handles the email delivery infrastructure (queues, providers, templates). Business logic triggers (e.g., "Send welcome email on signup") are implemented in your application's service layer or event handlers, utilizing this sending capability.

Need a Landing Page?

Modern landing pages with optional modules (blog, docs, forms, i18n). Let's discuss your project.

Build Your MVP

Full-stack SaaS development. Expert in database design, multi-tenancy, and scalable architecture.

Deployment Help

Dockerize your backend, set up CI/CD pipelines, deploy to Cloudflare or Hetzner. Early-stage setup.

Suggest a SaaS Tool

Missing a calculator or tool? Suggest what you'd like to see on our site.