# Email sending and OAuth provider configuration
#
# Default provider is 'console' (logs to stdout — safe for development).
# Switch to 'smtp' or 'sendgrid' for real delivery and set the corresponding
# env vars in .env (SMTP_USERNAME, SMTP_PASSWORD, SENDGRID_API_KEY, …).

let C = import "email/contracts.ncl" in

{
  email = {
    enabled           = false,
    provider          = "console",
    smtp_host         = "${SMTP_HOST}",
    smtp_port         = 587,
    smtp_username     = "${SMTP_USERNAME}",
    smtp_password     = "${SMTP_PASSWORD}",
    smtp_use_tls      = true,
    smtp_use_starttls = true,
    sendgrid_api_key  = "${SENDGRID_API_KEY}",
    sendgrid_endpoint = "https://api.sendgrid.com/v3/mail/send",
    from_email        = "${EMAIL_FROM}",
    from_name         = "${EMAIL_FROM_NAME}",
    template_dir      = "site/templates/email",
    email_enabled     = false,
  } | C.EmailConfig,

  oauth = {
    enabled = false,
  } | C.OAuthConfig,
}
