ISC License
The Ginkgo classroom at Lee Montessori has three weekly services provided by student families. This project parses the sign-up sheet in tsv
form and sends reminder emails to the families who have signed up a few days beforehand.
To run the function, you need a .env
file with
/d/
)You can use the sample.env
file, included in the repo, as reference.
cp sample.env .env
Sending these emails to actual people requires a src/familyEmails.js
file, which is not included in this repo for privacy reasons. Consult src/sample.familyEmails.js
for reference on how to format it.
Scheduling the script to actually run is done through the AWS console using CloudWatch, not through any configuration present in this project.
The function is an AWS lambda, which gets uploaded and independently scheduled via CloudWatch to run daily at a certain time (8 AM, currently). It is controlled via a few different flags in the event object it receives:
key | type | Description | Default |
---|---|---|---|
debug | boolean | Displays more information via console.log when run, and doesn't send any actual emails. | true |
date | string | Override the automatic date with a different date of your choosing. | undefined |
sendToRealPeople | boolean | Setting this to true will send notifications to actual people: if false, sends all email to me. | false |
To start, you'll need node. Then run
npm install
You can invoke the function locally using the event object in debug-send-event.js
:
# runs the current src/index.js
npm run invoke
# runs the current built file in build/index.js
npm run invoke-built
The project uses webpack to bundle and minify the JavaScript into a single file, then zips it and the other files it needs into a single file, ready to upload.
To actually upload these changes to AWS, make sure you have the aws-cli
set up and properly credentialed, then run
npm run upload