Skip to content

brentirwin/sfs-emailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sfs-emailer

This script pulls data from the SFS ROTA on Google Docs and generates daily and weekly call emails as necessary.

Arguments

  • -w: Sends weekly call, daily is default.
  • -e: Email the developer if an error happens.
  • -s: Use sample data and email developer.
  • -t: Test, print out results instead of emailing.

Setup

Install dependencies:

pip install -r requirements.txt

Add these lines to crontab -e:

5 6 * * * PYTHONPATH='/PATH/TO/SCRIPT' python3 /PATH/TO/SCRIPT/run.py -e > /PATH/TO/SCRIPT/log 2>&1
* 6 1 * * PYTHONPATH='/PATH/TO/SCRIPT' python3 /PATH/TO/SCRIPT/run.py -ew > /PATH/TO/SCRIPT/log 2>&1

to run the daily script every morning at 6:05am and the weekly script every Monday morning at 6am.

Google Drive API info saved at src/client_secret.json exactly as it's downloaded.

Create a file at src/config.py with the following format:

email_config = {
  'from': '',
  'password': '',
  'dev': '' # developer's email address
}

gdrive_config = {
  'addresses': 'GDRIVE_DOCUMENT_ID',
  'rota': 'GDRIVE_DOCUMENT_ID'
}

rota_config = {
  'rows': [7, 23] # Can be updated if shows are added or removed, span of relevant content
}

About

Send automatic daily and weekly call emails for SFS based on Google Docs data (personal)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages