πŸ“Š

Payroll Emailer

Send personalized payslip emails to employees from Excel data.

Excel ⭐⭐⭐ Advanced ⏱️ 10 minutes

😫 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.xlsx with columns β€˜Name’, β€˜Email’, β€˜Net_Salary’, β€˜Payslip_PDF’. Write a Python script using smtplib to:

  1. Email Template: 'Dear {Name}, Your salary of {Net_Salary} VND has been processed.'
  2. Attachment: Attach the corresponding PDF file.
  3. Throttle: 1 email per 2 seconds to avoid spam flags.
  4. 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

  1. Enable Gmail App Password.
  2. Copy Prompt β†’ Configure SMTP β†’ Run.

⚠️ Security: Never commit SMTP credentials to code. Use environment variables.

Related Workflows

Explore other categories

πŸ“¬

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

πŸ“– Free eBook Guide πŸ“¦ 7 Ready-to-use Scripts πŸ”” Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.