{% extends "base.html" %} {% block title %}Email Settings{% endblock %} {% block content %}

Email Settings

SMTP configuration and security notification settings. Values are loaded from environment variables — edit your .env file to change them.

{% if smtp_enabled %} SMTP Configured {% else %} SMTP Not Configured {% endif %}

SMTP Configuration

Set via environment variables

Host
{{ smtp_host or '—' }}:{{ smtp_port }}
Username
{% if smtp_user %}{{ smtp_user }}{% else %}Not set{% endif %}
From Address
{{ smtp_from_name }} <{{ smtp_from_email }}>
Password
{% if smtp_user %} •••••••• (set via SMTP_PASSWORD) {% else %} Not set {% endif %}
{% if not smtp_enabled %}
SMTP not configured. Add SMTP_USER and SMTP_PASSWORD to your .env file to enable email sending.
{% endif %}

Security Notifications

Emails sent automatically on security events

{% set notifications = [ ("Password changed", "Sent when a user changes or resets their password", "fa-key", True), ("2FA enabled", "Sent when two-factor authentication is enabled on an account", "fa-mobile-alt", True), ("2FA disabled", "Sent when two-factor authentication is disabled on an account", "fa-mobile-alt", True), ("Account locked", "Sent when an account is locked due to failed login attempts", "fa-lock", True), ("New login", "Sent on every login (optional, off by default)", "fa-sign-in-alt", False), ] %} {% for label, description, icon, is_default in notifications %}

{{ label }}

{{ description }}

{% if security_notifications_enabled %} {% if is_default or security_login_notifications %} Active {% else %} Disabled {% endif %} {% else %} Off (master switch) {% endif %}
{% endfor %}
Controlled by SECURITY_NOTIFICATIONS_ENABLED and SECURITY_LOGIN_NOTIFICATIONS in your .env file.

Send Test Email

Verify your SMTP configuration is working

Environment Variables Reference

SMTP_HOST=smtp.gmail.com

SMTP_PORT=587

SMTP_USER=you@gmail.com

SMTP_PASSWORD=app-password

SMTP_FROM_EMAIL=noreply@app.com

SMTP_FROM_NAME=MyApp

SECURITY_NOTIFICATIONS_ENABLED=true

SECURITY_LOGIN_NOTIFICATIONS=false

{% endblock %}