PyCon emailer contains a bunch of scripts that are useful for sending bulk emails to participants as and when required. You just need to get the data dump in csv files and make small changes in the scripts to read the data from files and send the emails.
The emailer has 2 scripts one for sending emails with attachements attachment_emailer.py and other uses a sengrid transactional template for sending bulk emails emailer.py
The scripts uses sendgrid python api to send emails. To use the script first signup on sendgrid and get an API key. Then follow the following steps
- Create a
sendgrid.env
file and export the api key there. You can simply use this commands
echo "export SENDGRID_API_KEY='YOUR_SENGRID_API_KEY'" > sendgrid.env
-
Next add the csv data in relevant csv files. In case you have some differnt data you can change the scripts to read the appropriate keys.
-
Run the sengrid.env file using
source sendgrid.env
to export the API key -
Install dependencies using
pip install requirements.txt
-
Run the scripts and the emails will be sent with the log printed in the terminal