Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ShakyW committed May 9, 2023
2 parents 8341c13 + 2cbeff9 commit a660aa7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions scripts/email_weekly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
This script is a scheduled call to the remind web endpoint. That endpoint emails group heads who have had their group code used in the past 24 hours with a reminder email to check the dashboard. You can follow through the code in the admin blueprint.
This script should be scheduled daily.
"""

# test for local commit

import os
import sys
import requests
from dotenv import load_dotenv

load_dotenv()
os.chdir(os.path.dirname(os.path.abspath(__file__)))


# TODO:
# 1) More secure storage of API key
# 2) Post URL's shouldn't be public

params = {'API_KEY': os.environ['API_KEY']}
if os.environ['FLASK_DEBUG'] == 'True':
requests.post('http://localhost:5000/api/remind/', params=params)
else:
requests.post('https://www.eabsentee.org/api/remind/', params=params)

0 comments on commit a660aa7

Please sign in to comment.