Skip to content

Commit

Permalink
Update generate_event_reminders.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremymanning authored Jul 18, 2024
1 parent ced1b8d commit 6994c56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions generate_event_reminders.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pandas as pd
import yaml
from datetime import datetime, timedelta
import markdown

# Create the scripts directory if it doesn't exist
if not os.path.exists('scripts'):
Expand Down Expand Up @@ -30,6 +31,7 @@ def create_event_script(event_name, date_str, content, frequency, day_of_week, d
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import markdown
import os
# Load email addresses
emails_df = pd.read_csv('email_addresses.csv')
Expand Down Expand Up @@ -67,7 +69,7 @@ def create_event_script(event_name, date_str, content, frequency, day_of_week, d
# Send email
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(sender_email, "${{ secrets.GMAIL_PASSWORD }}")
server.login(sender_email, os.getenv("GMAIL_PASSWORD"))
text = msg.as_string()
server.sendmail(sender_email, admin_emails + organizer_emails, text)
server.quit()
Expand All @@ -92,7 +94,7 @@ def create_event_script(event_name, date_str, content, frequency, day_of_week, d
{'name': 'Checkout repository', 'uses': 'actions/checkout@v2'},
{'name': 'Set up Python', 'uses': 'actions/setup-python@v2', 'with': {'python-version': '3.x'}},
{'name': 'Install dependencies', 'run': 'pip install pandas markdown'},
{'name': 'Run email script', 'run': f'python scripts/send_email_{event_name.replace(" ", "_")}.py'}
{'name': 'Run email script', 'run': f'python scripts/send_email_{event_name.replace(" ", "_")}.py', 'env': {'GMAIL_PASSWORD': "${{ secrets.GMAIL_PASSWORD }}"}}
]
}
}
Expand Down

0 comments on commit 6994c56

Please sign in to comment.