Email Providers
Postiz supports three email providers:- Resend - Modern email API (recommended)
- NodeMailer - SMTP-based email delivery
- Empty - No email delivery (auto-activation)
Environment Variables
Required Settings
Add these variables to your.env file:
If
EMAIL_PROVIDER is not set, Postiz uses the Empty provider and automatically activates users without email verification.Provider-Specific Configuration
Setup with Resend (Recommended)
Resend is the recommended email provider for production deployments.Create Resend Account
- Visit resend.com and create an account
- Verify your email address
- Navigate to the API Keys section
Generate API Key
- Click “Create API Key”
- Name it “Postiz Production” or similar
- Select “Sending access” permission
- Copy the API key (starts with
re_)
Verify Domain
To send from your own domain:
- Go to Domains → Add Domain
- Enter your domain (e.g.,
yourdomain.com) - Add the provided DNS records to your domain:
- SPF record
- DKIM record
- DMARC record (optional but recommended)
- Wait for verification (usually 5-15 minutes)
Configure Environment
Add to your
.env file:Use a subdomain like
noreply@ or notifications@ for transactional emails to avoid deliverability issues.Setup with NodeMailer (SMTP)
Use NodeMailer if you have an existing SMTP server or email service.Get SMTP Credentials
Obtain SMTP credentials from your email provider:
- Gmail: Use App Passwords (requires 2FA enabled)
- SendGrid: Get SMTP credentials from Settings
- Mailgun: Use SMTP credentials from domain settings
- Custom SMTP: Get from your hosting provider
Common SMTP Providers
Email Service Implementation
The email service (email.service.ts) automatically selects the configured provider:
Provider Validation
Each provider validates required environment variables on initialization:Email Templates
Postiz sends beautifully formatted HTML emails with automatic styling:Template Features
- Gradient background (
#e6f2ffto#f0e6ff) - Responsive card layout with backdrop blur
- Automatic subject line as heading
- Branded footer with notification preferences link
- Links to user settings:
{FRONTEND_URL}/settings
Email Workflow
Emails are sent through Temporal workflows for reliability:Temporal workflows provide automatic retries (up to 3 attempts) with exponential backoff for failed email deliveries.
User Activation Behavior
With Email Provider Configured
- User registers
- Activation email sent to user’s email
- User must click activation link
- Account becomes active
Without Email Provider (Empty Provider)
- User registers
- Account is automatically activated
- No email verification required
Disabling User Registration
To disable new user registration entirely:Testing Email Delivery
Troubleshooting
Emails not sending (Resend)
Emails not sending (Resend)
Check the following:
- API Key Valid: Verify your Resend API key starts with
re_and is active - Domain Verified: Ensure your domain is verified in Resend dashboard
- Rate Limits: Check you haven’t exceeded Resend’s rate limits (check dashboard)
- Logs: Check backend logs for detailed error messages
Emails not sending (NodeMailer)
Emails not sending (NodeMailer)
Common issues:
- Wrong Port: Use 587 for STARTTLS, 465 for SSL/TLS
- Authentication Failed: For Gmail, use App Passwords, not your regular password
- Firewall: Ensure your server can make outbound SMTP connections
- SMTP Disabled: Some email providers require enabling SMTP access
Emails going to spam
Emails going to spam
Improve deliverability:
- Verify Domain: Complete SPF, DKIM, and DMARC setup
- Warm Up: Start with low volume and gradually increase
- Content: Avoid spam trigger words and excessive links
- Reply-To: Set a valid reply-to address
- Unsubscribe: Include unsubscribe link (automatic in Postiz emails)
Missing environment variables warning
Missing environment variables warning
If you see:
- Verify the variable is set in
.env - Ensure no extra spaces:
RESEND_API_KEY="value"notRESEND_API_KEY = "value" - Restart the backend service
- Check the variable is loaded:
docker compose exec backend env | grep RESEND
Email service provider shows 'empty'
Email service provider shows 'empty'
If logs show:The
EMAIL_PROVIDER variable is not set or invalid. Valid values:resendnodemailer
.env and restart:Email Notification Preferences
Users can manage their email notification preferences at:Monitoring and Debugging
Enable Debug Logging
Increase log verbosity to debug email issues:Check Email Service Initialization
Monitor Email Queue
Emails are processed asynchronously through Temporal. Check workflow status:Rate Limits
Resend
- Free tier: 100 emails/day
- Paid tier: Based on your plan
- Automatic retry with exponential backoff
NodeMailer
Rate limits depend on your SMTP provider:- Gmail: 500 emails/day (free), 2000/day (Google Workspace)
- SendGrid: Based on your plan
- Mailgun: Based on your plan
Security Best Practices
- Store API keys and passwords in environment variables
- Use App Passwords for Gmail, never your main password
- Rotate API keys regularly
- Monitor email logs for suspicious activity
- Implement rate limiting on user registration
- Use HTTPS for all email links
Next Steps
After configuring email:- OAuth Apps - Set up social media integrations
- AI Integration - Enable AI features
- Billing Configuration - Set up Stripe payments