Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions {{cookiecutter.project_slug}}/.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ SECRET_KEY={{cookiecutter.secret_key}}
FIRST_SUPERUSER={{cookiecutter.first_superuser}}
FIRST_SUPERUSER_PASSWORD={{cookiecutter.first_superuser_password}}
SMTP_TLS=True
SMTP_SSL=True
SMTP_PORT={{cookiecutter.smtp_port}}
SMTP_HOST={{cookiecutter.smtp_host}}
SMTP_USER={{cookiecutter.smtp_user}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def assemble_db_connection(cls, v: Optional[str], values: Dict[str, Any]) -> Any
)

SMTP_TLS: bool = True
SMTP_SSL: bool = True
SMTP_PORT: Optional[int] = None
SMTP_HOST: Optional[str] = None
SMTP_USER: Optional[str] = None
Expand Down
2 changes: 2 additions & 0 deletions {{cookiecutter.project_slug}}/backend/app/app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def send_email(
mail_from=(settings.EMAILS_FROM_NAME, settings.EMAILS_FROM_EMAIL),
)
smtp_options = {"host": settings.SMTP_HOST, "port": settings.SMTP_PORT}
if settings.SMTP_SSL:
smtp_options["ssl"] = True
if settings.SMTP_TLS:
smtp_options["tls"] = True
if settings.SMTP_USER:
Expand Down