This mass emailer uses the sendgrid api. So before using this make sure you have Sendgrid account which you can create it by visiting sendgrid.com and select the package which fits you right.
License: MIT opensource
Author: Prashant Kumar Dey
Version: 0.1
Panel Used: Sendgrid
HTML Template: Template was generated through BeeFree
- python3
sudo apt-get install python3
- python3-pip
sudo apt-get install python3-pip
Step 1: Go to Settings (on left menu bar) and then click on Mail Settings. Configure your domain here.
Step 2: Go to Marketing and then click on Senders and configure the email address that you want to send email from.
Step 3: Go to Email API and then click Integration Guide. Choose Web API and then choose Python as programming language.
Step 4: Create API Key and save the API key somewhere. Check the box which says I've integrated the code above. and then click on Next: Verify Integration
git clone https://github.com/UnpredictablePrashant/SendgridMassEmailer.git
cd SendgridMassEmailer
Replace YOUR_API_KEY with the API_KEY that you have copied in the previous step and run the below command.
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
Install sendgrid python dependency.
pip3 install sendgrid
Open emailer.py file and replace SENDGRID_API_CREDENTIALS with the API_KEY that you have obtained from the above step.
Change the value of from_email from test@test.com to the email address that you want to send through.
- Create a database file with the list of email inside the
Databasefolder. You can see the sampletestDatabase.txtfile inside the folderDatabase. - Create HTML email template file and put this file inside the
EmailTemplatesfolder. You can see a sample html filecybersecurity.htmlinside the folderEmailTemplates.
python3 emailer.py
Enter the name of the database file. Example: database.txt
Enter the name of the HTML template. Example: cybersecurity.html
Enter the subject of the email. Example: Get Free courses on cybersecurity
Report is generated inside the Reports folder with the date and time when the program was started.
If you have identified any bugs or if you feel like there is any source of improvements then feel free to write me at prashantsavior@gmail.com