Supported Email Providers
Modelence supports the following email providers:- Resend - Modern email API service
- Amazon SES - AWS Simple Email Service
- SMTP - Any SMTP-compatible email service
Configuration Steps
1. Install the Email Provider Package
First, install the email provider package you want to use:2. Configure Your Email Provider
Option A: Cloud Configuration (Recommended)
The easiest way to configure your email provider is through the Modelence Cloud dashboard:- Go to cloud.modelence.com
- Choose your environment
- Open Application tab
- Select the Email configuration section
- Choose your email provider and enter the required credentials:
- API Key (get it from resend.com/api-keys)
- Region (e.g.,
us-east-1
) - Access Key ID
- Secret Access Key
- Host (e.g.,
smtp.gmail.com
) - Port (usually
465
for secure connections) - Username
- Password
- Save your configuration
Option B: Local Environment Variables (Backup)
Alternatively, you can set environment variables locally. This is useful for development or when you prefer to manage credentials through environment variables: For Resend:3. Set Up Email Configuration in Your Server
In your server configuration file (typically where you callstartApp
), configure the email settings using the email
property:
Advanced Configuration
Custom Email Templates
You can customize the email templates for verification and password reset emails:Sending Custom Emails
You can also send custom emails using thesendEmail
function:
Email Payload Options
ThesendEmail
function accepts the following options:
html
or text
(or both).
Adding Attachments
Troubleshooting
Error: “Email provider is not configured”
This error occurs when you try to send an email without configuring an email provider. Make sure you:- Installed the email provider package
- Configured your credentials either through cloud.modelence.com or environment variables
- Set the
email
property instartApp()
with a provider
SMTP Connection Issues
If you’re using SMTP and experiencing connection issues:- Verify your SMTP credentials are correct
- Check that the port is correct (usually 465 for secure connections)
- Ensure your firewall allows outbound connections on the SMTP port
- Some email providers require you to enable “less secure app access” or create an app-specific password
AWS SES Sending Limits
If you’re in the AWS SES sandbox:- You can only send emails to verified email addresses
- Request production access to send to any email address
- Verify your sending domain or individual email addresses in the AWS Console
Next Steps
- Learn about Authentication to understand how email verification works
- Explore User Management features
- Review the API Reference for more details on email functions