From 154a20d1d8a61e801af4f3783abc90b0e108aa6d Mon Sep 17 00:00:00 2001 From: Vijay Gill Date: Sat, 9 Nov 2024 03:16:57 +0000 Subject: [PATCH] Fixed minor issues with email. --- src/api_project/api_app/views.py | 5 +++-- src/api_project/api_project/settings.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api_project/api_app/views.py b/src/api_project/api_app/views.py index 8c2233d..70b6f05 100644 --- a/src/api_project/api_app/views.py +++ b/src/api_project/api_app/views.py @@ -258,11 +258,12 @@ def get_server_status(request): @permission_classes([IsAuthenticated]) def send_peer_email(request): try: + peer_name = request.data["name"] tunnel_qr_file = "tunnel.png" tunnel_conf_file = "tunnel.conf" - subject = "Tunnel configuration sent from wg-ui-plus" + subject = f"Tunnel configuration sent from wg-ui-plus for {peer_name}" body = f""" -The attached files are sent from {APP_NAME}. +The attached files are sent from {APP_NAME} for the peer {peer_name}. Keep them safe. Notify the administrator if you think the files have been compromised. diff --git a/src/api_project/api_project/settings.py b/src/api_project/api_project/settings.py index 1588032..f3b7b0c 100644 --- a/src/api_project/api_project/settings.py +++ b/src/api_project/api_project/settings.py @@ -147,7 +147,7 @@ EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD", None) EMAIL_PORT = os.environ.get("EMAIL_PORT", None) EMAIL_USE_SSL = os.environ.get("EMAIL_USE_SSL", None) -EMAIL_USE_TLS = os.environ.get("EMAIL_USE_SSL", None) +EMAIL_USE_TLS = os.environ.get("EMAIL_USE_TLS", None) LOGGING = {