Automates the mailing process for KOSS during various events like KWoC and selections.
Warning Always do a test run before using the scripts, there are many things which might go wrong and we can't afford sending broken/incorrect mails to the reciepients.
For the first time, you need to generate token for api.
Either use already available templates or create a new template with the conventions mentioned in about templates.
Make sure the the column names for name
and email
entries are one of those mentioned in variable_mappings.py.
Make sure the files are stored in correct directory:
./templates/
../csv/
, Hence no need to mention them again while specifying the location, just speciy the location after these default directories.
Use the script according to your needs, bcc.py
or one-to-one.py
. Both follow same method of execution
python3 script.py <template> <csv_file> (OPTIONAL)<variables with same value for all mails>
Here are one example for each case supported:
python3 one-to-one.py selections/onboarding onboarding.csv number_of_applicants="250+"
python3 one-to-one.py selections/task day1.csv deadline="Monday, 9 June 2023"
python3 bcc.py selections/rejection rejected.csv
python3 bcc.py selections/round1-interview-slot r1d1.csv slot_time="Tuesday, 3 June 2023, 10:00 PM - 11:00 PM" lobby_link="https://meet.google.com/xxx-xxxx-xxx"
python3 bcc.py selections/round2-interview-slot r2d2.csv slot_time="Tuesday, 3 June 2023, 10:00 PM - 11:00 PM" lobby_link="https://meet.google.com/xxx-xxxx-xxx"
Follow the steps at Gmail API - Python Quickstart guide to get credentials.json
.
Note
credentials.json
is permanent until you delete it in your google clound console.
And make sure to addadmin@kossiitkgp.org
as a test user in case you made the app internal.
Follow the steps below to generate token.json
:
credentials.json
Import the required module
pip install google-auth-oauthlib
Execute gentokenjson.py
with send
argument
python3 gentokenjson.py send
Continue
instead of Back To SafetyContinue
againtoken.json
will be generated in same folder as that of credentials.json
Warning
token.json
expires after sometime. So make sure to check that in your projects and keep refreshing it.