From c50b69e85223421e567e8b3179ec911e16d030b4 Mon Sep 17 00:00:00 2001 From: Chinenye Nmoh Date: Thu, 17 Jul 2025 12:42:22 +0100 Subject: [PATCH] added mail values in the env file --- app/config.py | 6 +++--- app/routes/autocall.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/config.py b/app/config.py index 948a00a..abfd996 100644 --- a/app/config.py +++ b/app/config.py @@ -44,11 +44,11 @@ class Config: MAIL_SERVER = os.getenv('MAIL_SERVER','smtp.zoho.com') - MAIL_PORT = 587 + MAIL_PORT = os.getenv('MAIL_PORT', 587) MAIL_USERNAME = os.getenv('MAIL_USERNAME', 'firstadvance@dynamikservices.tech') MAIL_PASSWORD = os.getenv('MAIL_PASSWORD') - MAIL_USE_TLS = True - MAIL_USE_SSL = False + MAIL_USE_TLS = os.getenv('MAIL_USE_TLS', 'True').lower() in ('true', '1', 'yes') + MAIL_USE_SSL = os.getenv('MAIL_USE_SSL', 'False').lower() in ('true', '1', 'yes') MAIL_DEFAULT_SENDER = ('FirstAdvance', 'firstadvance@dynamikservices.tech') MAIL_RECEIVER= os.getenv('MAIL_RECEIVER', 'chinenyeumeaku@gmail.com,umeakuchinenye@gmail.com') diff --git a/app/routes/autocall.py b/app/routes/autocall.py index 7a291b6..279826a 100644 --- a/app/routes/autocall.py +++ b/app/routes/autocall.py @@ -251,7 +251,7 @@ def report(): send_report_email( report_data, recipients = [email.strip() for email in settings.MAIL_RECEIVER.split(",")]) - + logger.info(f"Report sent successfully") return ResponseHelper.success(message="Report sent successfully",status_code=200) except Exception as e: logger.error(f"Error generating or sending report: {e}") -- 2.34.1