Skip to content

Commit

Permalink
email notification: remove env vars from global scope
Browse files Browse the repository at this point in the history
  • Loading branch information
DenitsaTH committed Jun 6, 2024
1 parent a749e9e commit 7affdb0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/app/email_notification.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from mailjet_rest import Client
import os
from dotenv import load_dotenv

load_dotenv()

api_key = os.environ['MAIL_API_KEY']
api_secret = os.environ['MAIL_API_SECRET_KEY']
sender_mail = os.environ['SENDER_EMAIL']
def email_vars_setup():
api_key = os.getenv('MAIL_API_KEY')
api_secret = os.getenv('MAIL_API_SECRET_KEY')
sender_mail = os.getenv('SENDER_EMAIL')

return api_key, api_secret, sender_mail


api_key, api_secret, send_email = email_vars_setup()
mailjet = Client(auth=(api_key, api_secret), version='v3.1')


Expand Down

0 comments on commit 7affdb0

Please sign in to comment.