- Takes an excel input and saves each (half) sheet as a pdf
- Sends out pdf as an email attachment using AWS Simple Email Service (SES)
Context: Sending out monthly payslips to employees NEW: Use Gooey package to create user interface
- AWS Account and credentials for SES
- Python3
- Windows environment
- Microsoft Excel
python -m venv venv
venv\Scripts\activate
(venv) pip install -r requirements.txt- Creates a SES Config set
- Creates a SNS Topic for failed delivery -> triggers email sent (email subscription done manually)
- Creates a SNS Topic for successful delivery -> triggers lambda function that logs output to Cloudwatch
- Create a lambda function to log successful and unsuccessful email delivery
- Create an IAM user with permissions to send raw email
- Running on Windows: Create a batch script "Payslip.bat" with contents as per below. Run the batch file.
"C:\Users\xxx\venv\Scripts\python.exe" "path/to/payslips-mailer-runner.py"
TIP: Use where python to get the path of python executable
- Running from command line
(venv) python payslip-mailer-runner.py- use AWS SES configuration set to monitor email delivery
- SES pricing: $0.10 for every 1,000 emails sent/mth
- SNS pricing: 1,000 email notifications/mth (free tier), no charges to lambda (1GB/mth free data transfer out of SNS)
- Lambda pricing: $0.20 per 1M requests/mth, $0.17 per 10,000 GB-seconds of compute time/mth