Skip to content
Open
Prev Previous commit
Next Next commit
chore(email): add SMTP runtime environment vars
Expose SMTP configuration through the app env surface so self-hosted operators can wire a custom mail server without patching code.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
  • Loading branch information
wickedev and sisyphus-dev-ai committed Mar 21, 2026
commit 304d0f683117c91c2e5d06b67569ca8efbdff865
10 changes: 10 additions & 0 deletions apps/sim/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ API_ENCRYPTION_KEY=your_api_encryption_key # Use `openssl rand -hex 32` to gener
# Email Provider (Optional)
# RESEND_API_KEY= # Uncomment and add your key from https://resend.com to send actual emails
# If left commented out, emails will be logged to console instead
# FROM_EMAIL_ADDRESS="Sim <noreply@example.com>"
# EMAIL_DOMAIN=example.com

# SMTP (Optional - alternative to Resend/Azure for self-hosting)
# If multiple providers are configured, Sim tries Resend first, then Azure, then SMTP.
# SMTP_HOST=smtp.example.com
# SMTP_PORT=587
# SMTP_SECURE=TLS # TLS (STARTTLS), SSL (implicit TLS, usually 465), or None
# SMTP_USERNAME=your_smtp_username
# SMTP_PASSWORD=your_smtp_password

# Local AI Models (Optional)
# OLLAMA_URL=http://localhost:11434 # URL for local Ollama server - uncomment if using local models
Expand Down
5 changes: 5 additions & 0 deletions apps/sim/lib/core/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ export const env = createEnv({
PERSONAL_EMAIL_FROM: z.string().min(1).optional(), // From address for personalized emails
EMAIL_DOMAIN: z.string().min(1).optional(), // Domain for sending emails (fallback when FROM_EMAIL_ADDRESS not set)
AZURE_ACS_CONNECTION_STRING: z.string().optional(), // Azure Communication Services connection string
SMTP_HOST: z.string().min(1).optional(), // SMTP server hostname for self-hosted email delivery
SMTP_PORT: z.string().regex(/^\d+$/).optional(), // SMTP server port (e.g. 587, 465)
SMTP_SECURE: z.enum(['TLS', 'SSL', 'None']).optional(), // SMTP security mode (STARTTLS, implicit TLS, or plain)
SMTP_USERNAME: z.string().min(1).optional(), // SMTP username for authenticated relays
SMTP_PASSWORD: z.string().min(1).optional(), // SMTP password for authenticated relays

// SMS & Messaging
TWILIO_ACCOUNT_SID: z.string().min(1).optional(), // Twilio Account SID for SMS sending
Expand Down