π« The Pain Point
Every month you need to email 100 employees their payslips. Each email has personalized salary info. Sending individually takes hours.
π Agentic Solution
An Automated Payroll Emailer with template support and attachment handling.
Key Features:
- Template Emails: Personalize with employee data.
- PDF Attachments: Attach individual payslip PDFs.
- Send Throttling: Rate limit to avoid spam filters.
βοΈ Phase 1: Commander (Quick Fix)
For quick emailing.
Prompt:
βI have an Excel
payroll.xlsxwith columns βNameβ, βEmailβ, βNet_Salaryβ, βPayslip_PDFβ. Write a Python script using smtplib to:
- Email Template:
'Dear {Name}, Your salary of {Net_Salary} VND has been processed.'- Attachment: Attach the corresponding PDF file.
- Throttle: 1 email per 2 seconds to avoid spam flags.
- Log: Track sent/failed status.
Use Gmail SMTP with App Password. Print progress.β
Result: All payslips delivered without manual work.
ποΈ Phase 2: Architect (Permanent Tool)
Engineering Prompt:
**Role:** Python Tool Developer
**Task:** Create a "Bulk Payslip Emailer".
**Requirements:**
1. **GUI:**
* Select Excel file.
* Email template editor with variable placeholders.
* SMTP config (server, port, credentials).
* Attachment column picker.
* Test mode (send to self first).
* Progress bar + log.
2. **Logic:**
* Secure credential handling (environment variables).
* Rate limiting.
* Retry failed sends.
* Detailed logging.
3. **Deliverables:**
* `payroll_emailer.py`
* `run.bat`, `run.sh`
* `requirements.txt`
π§ Prompt Decoding
- App Password: Gmail requires App Password for programmatic access, not regular password.
π οΈ Instructions
- Enable Gmail App Password.
- Copy Prompt β Configure SMTP β Run.
β οΈ Security: Never commit SMTP credentials to code. Use environment variables.