Email Types
VulnTrack sends three types of automated emails:Invitations
Secure invitation links for new team members with 24-hour expiration.
Password Resets
Time-limited password reset links with 1-hour expiration.
Assignments
Notifications when vulnerabilities are assigned to analysts.
Setup with Resend
Create Resend account
Sign up at resend.com and verify your email.
Add and verify domain
Navigate to Domains in the Resend dashboard:
- Click Add Domain
- Enter your domain (e.g.,
vulntrack.yourdomain.com) - Add the provided DNS records to your domain:
- SPF record for sender authentication
- DKIM records for email signing
- MX record (optional, for receiving replies)
DNS propagation can take up to 48 hours. Use Resend’s verification tool to check status.
Generate API key
In the Resend dashboard:
- Go to API Keys
- Click Create API Key
- Name it (e.g., “VulnTrack Production”)
- Copy the key immediately (it won’t be shown again)
Environment Variables
Your Resend API key for sending emails.Format:
re_xxxxxxxxxxxxGet from: Resend Dashboard > API KeysIf not set, VulnTrack will operate in mock mode and log emails to console instead of sending them.Sender email address displayed in outgoing emails.Format:
Display Name <[email protected]>Examples:VulnTrack <[email protected]>Security Team <[email protected]>VulnTrack Alerts <[email protected]>
Base URL used in email links.Development:
http://localhost:3000Production: https://vulntrack.yourdomain.comThis URL is prepended to invitation and password reset links.Email Templates
VulnTrack uses custom HTML email templates defined insrc/lib/email-templates.ts.
Invitation Email
Triggered when: Admin sends a team invitation Contains:- Personalized greeting
- Invitation acceptance button
- Link expiration warning (24 hours)
- Direct link fallback
src/lib/email-templates.ts:67
Password Reset Email
Triggered when: User requests password reset Contains:- Reset password button
- Security notice
- Link expiration warning (1 hour)
- Ignore instructions for unsolicited resets
src/lib/email-templates.ts:95
Assignment Notification
Triggered when: Vulnerability is assigned to a user Contains:- Vulnerability title and ID
- Direct link to vulnerability details
- Call to action for remediation
src/lib/email-templates.ts:123
Email Service (src/lib/email.ts)
The core email sending function:src/lib/email.ts:17
Mock Mode
WhenRESEND_API_KEY is not set, emails are logged to console:
- Local development without Resend account
- Testing email triggers
- CI/CD environments
Production Mode
WithRESEND_API_KEY configured, emails are sent via Resend:
Sending Emails from Code
Example: Send invitation
Example: Send password reset
Example: Send assignment notification
Template Customization
Email templates use inline CSS for maximum email client compatibility.Shared Styles (src/lib/email-templates.ts:1)
Customization Options
Testing Emails
Local Testing (Mock Mode)
Production Testing
Test all templates
Manually trigger each email type:
- Send a test invitation
- Request a password reset
- Assign a vulnerability
Troubleshooting
Emails not sending
Emails not sending
Symptoms: No emails received, no errors in consoleSolutions:
- Verify
RESEND_API_KEYis set correctly - Check Resend dashboard for API errors
- Ensure domain is verified in Resend
- Check rate limits (Resend free tier: 100 emails/day)
Domain verification failed
Domain verification failed
Symptoms:
Domain not verified errorSolutions:- Wait 24-48 hours for DNS propagation
- Use Resend’s verification tool to check DNS records
- Ensure DNS records match exactly (no trailing dots or spaces)
- Try using
digornslookupto verify DNS changes
Emails go to spam
Emails go to spam
Symptoms: Emails delivered but marked as spamSolutions:
- Verify SPF, DKIM, and DMARC records are configured
- Use a professional sender address (not gmail.com)
- Add plain text version to emails
- Warm up your domain (send gradually increasing volumes)
Invalid FROM address
Invalid FROM address
Symptoms:
403 Forbidden or Invalid from addressSolutions:- Ensure
EMAIL_FROMuses your verified Resend domain - Check for typos in email address
- Verify domain verification status in Resend
Links not working in emails
Links not working in emails
Symptoms: Email links lead to 404 or wrong domainSolutions:
- Verify
NEXT_PUBLIC_APP_URLis set correctly - Ensure it matches your deployment URL
- Check for trailing slashes (should not have one)
- Test token generation and validation logic
Rate Limits
Resend free tier limits:- 100 emails per day
- 3,000 emails per month
Monitor usage in Resend Dashboard > Usage to avoid hitting limits.
Security Considerations
Secure API keys
Never commit
RESEND_API_KEY to version control. Use environment variables or secrets management.Time-limited tokens
Invitation and reset tokens expire automatically (24h and 1h respectively).
Single-use tokens
Tokens are consumed after first use to prevent replay attacks.
Verify senders
Always use verified domains to prevent spoofing and improve deliverability.