π« 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)
For HR Managers.
Engineering Prompt:
**Role:** Python GUI Developer (PyQt6 Specialist)
**Task:** Create "Bulk Payslip Emailer" Desktop App
**Objective:** A secure desktop tool to send personalized emails with attachments to employee lists.
**Tech Stack:**
* Language: Python 3.10+
* GUI Library: PyQt6 (Cross-platform)
* Email: smtplib, email.mime
* Packaging: PyInstaller
**Functional Requirements:**
1. **UI Layout (PyQt6):**
* **Data:** Excel File Source.
* **Template:** Rich Text Editor (or Text Area) for email body with `{Placeholders}`.
* **Config:** SMTP Settings (Server, Port, User, App Password - *Masked Input*).
* **Attachments:** Column selector for "PDF Path".
2. **Core Logic:**
* Iterate rows, replace placeholders in template.
* Attach files per row instructions.
* **Throttling:** Implement delay (e.g., 2s) between sends to avoid spam flags.
* **Threading:** Email loop runs in background thread.
3. **Deliverables:**
* `main.py`: Complete source code.
* `requirements.txt`: Dependencies.
* **Build Instructions:**
* Windows: `pyinstaller --onefile --noconsole main.py`
* macOS: `pyinstaller --windowed --noconsole main.py`
π§ 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.