Skip to content

Commit

Permalink
email server and .env setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansurf committed May 22, 2024
1 parent 6cf9fd1 commit bafac4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
PORT=8000
PORT=8000

SMTP_SERVER ='smtp.gmail.com'
EMAIL=your-email
EMAIL_PW=email-password
EMAIL_RECEIVER=email-to-receive-surf-report
COMMAND=localhost:8000
SUBJECT='Surf Report'
4 changes: 2 additions & 2 deletions src/send_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
load_dotenv()

# Email server configuration
SMTP_SERVER = 'smtp.gmail.com'
SMTP_SERVER = os.getenv('SMTP_SERVER')
PORT = 587 # Port for TLS connection

# Sender's email credentials
Expand All @@ -26,7 +26,7 @@
message = MIMEMultipart()
message['From'] = SENDER_EMAIL
message['To'] = RECEIVER_EMAIL
message['Subject'] = 'Test Email'
message['Subject'] = os.getenv('SUBJECT')

# Execute the command to get output
SURF = subprocess.run(['curl', os.getenv('COMMAND')], capture_output=True, text=True, check=True)
Expand Down

0 comments on commit bafac4a

Please sign in to comment.