Rustelo/config/others/email.toml
Jesús Pérex 515c9343f4
Some checks failed
CI/CD Pipeline / Test Suite (push) Has been cancelled
CI/CD Pipeline / Security Audit (push) Has been cancelled
CI/CD Pipeline / Build Docker Image (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Performance Benchmarks (push) Has been cancelled
CI/CD Pipeline / Cleanup (push) Has been cancelled
chore: add config path
2025-07-07 23:13:01 +01:00

109 lines
3.1 KiB
TOML

# Email Configuration
# This file contains email service configuration for different providers and environments
[email]
# Enable/disable email functionality
enabled = true
# Email provider: "smtp", "sendgrid", or "console"
# - smtp: Use SMTP server (Gmail, Outlook, etc.)
# - sendgrid: Use SendGrid API
# - console: Print emails to console (development only)
provider = "console"
# Default sender information
from_email = "noreply@yourapp.com"
from_name = "Your App Name"
# Template directory for email templates
template_dir = "templates/email"
# SMTP Configuration (when provider = "smtp")
smtp_host = "smtp.gmail.com"
smtp_port = 587
smtp_username = "your-email@gmail.com"
smtp_password = "your-app-password"
smtp_use_tls = false
smtp_use_starttls = true
# SendGrid Configuration (when provider = "sendgrid")
sendgrid_api_key = ""
sendgrid_endpoint = "https://api.sendgrid.com/v3/mail/send"
# Environment-specific overrides
[environments.development]
email.enabled = true
email.provider = "console"
[environments.staging]
email.enabled = true
email.provider = "smtp"
email.smtp_host = "smtp.mailtrap.io"
email.smtp_port = 2525
email.smtp_username = "your-mailtrap-username"
email.smtp_password = "your-mailtrap-password"
[environments.production]
email.enabled = true
email.provider = "sendgrid"
email.sendgrid_api_key = "${SENDGRID_API_KEY}"
email.from_email = "noreply@yourdomain.com"
email.from_name = "Your Production App"
# Email provider examples and setup instructions
# === SMTP Providers ===
# Gmail SMTP (App Passwords required)
# smtp_host = "smtp.gmail.com"
# smtp_port = 587
# smtp_username = "your-email@gmail.com"
# smtp_password = "your-16-char-app-password"
# smtp_use_starttls = true
# Outlook/Hotmail SMTP
# smtp_host = "smtp-mail.outlook.com"
# smtp_port = 587
# smtp_username = "your-email@outlook.com"
# smtp_password = "your-password"
# smtp_use_starttls = true
# Custom SMTP Server
# smtp_host = "mail.yourdomain.com"
# smtp_port = 587
# smtp_username = "noreply@yourdomain.com"
# smtp_password = "your-password"
# smtp_use_starttls = true
# === SendGrid Setup ===
# 1. Sign up at https://sendgrid.com
# 2. Create an API key in Settings > API Keys
# 3. Set the API key in sendgrid_api_key or SENDGRID_API_KEY environment variable
# 4. Verify your sender identity in Marketing > Sender Authentication
# === Development Testing ===
# For development, you can use:
# - Console provider (prints emails to terminal)
# - Mailtrap (https://mailtrap.io) for SMTP testing
# - MailHog (local SMTP testing server)
# === Environment Variables ===
# You can use environment variables in this config:
# ${VARIABLE_NAME} will be replaced with the environment variable value
#
# Common environment variables:
# - SMTP_HOST
# - SMTP_PORT
# - SMTP_USERNAME
# - SMTP_PASSWORD
# - SENDGRID_API_KEY
# - EMAIL_FROM_ADDRESS
# - EMAIL_FROM_NAME
# === Security Notes ===
# - Never commit real passwords or API keys to version control
# - Use environment variables for sensitive data in production
# - Enable 2FA and use app passwords for Gmail
# - Regularly rotate API keys and passwords
# - Monitor email sending quotas and limits