Email Technical Details
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.
Admin
The email module includes a comprehensive set of admin features to manage your email templates, view logs, and monitor analytics.
Overview
Listening to your customers is the key to building a great product. Our Feedback Platform provides a dedicated space for your users to share ideas, report issues, and vote on what features they want next.