Overview
Stack Auth provides customizable email templates for authentication flows. You can modify the subject lines and content to match your brand.Available Email Types
Stack Auth sends emails for the following events:email_verification- Email address verificationpassword_reset- Password reset requestsmagic_link- Passwordless authentication linksteam_invitation- Team membership invitationssign_in_invitation- Sign-in invitations for new userspayment_receipt- Payment confirmation receiptspayment_failed- Failed payment notifications
Email Template Structure
Each email template consists of:Customizing Email Templates
You can customize email templates through the Admin API:Create or Update Template
Reset to Default Template
Email Configuration
For development, Stack Auth uses Inbucket as a local email testing server. Configure email settings via environment variables:Email Testing
During development, emails are captured by Inbucket:Template Variables
Email templates support dynamic variables:{{verificationLink}}- Email verification URL{{resetLink}}- Password reset URL{{magicLink}}- Magic link URL{{inviteLink}}- Team invitation URL{{userName}}- User’s display name{{teamName}}- Team name (for invitations){{amount}}- Payment amount (for receipts)
Email Delivery Status
Track email delivery through the backend:Email Normalization
Stack Auth normalizes email addresses:- Converts to lowercase
- Trims whitespace
- Handles Gmail-style aliases (+ addressing)
Best Practices
- Test emails thoroughly before deploying to production
- Keep subjects clear and concise (under 50 characters)
- Include your brand name in the subject line
- Ensure links are accessible for at least 24 hours
- Monitor delivery rates and failed email notifications
- Comply with email regulations (CAN-SPAM, GDPR)
Troubleshooting
Emails Not Sending
- Verify SMTP credentials are correct
- Check that your SMTP provider allows sending from your domain
- Review email queue for errors:
pnpm db:seedthen check dashboard - Ensure recipient email addresses are valid
Emails Going to Spam
- Configure SPF, DKIM, and DMARC records for your domain
- Use a reputable email service provider (SendGrid, Postmark, etc.)
- Avoid spam trigger words in subject lines
- Include an unsubscribe link (for marketing emails)