📊

Payroll Emailer

Securely send bulk emails with personalized attachments (e.g., Payslips) to employees.

Excel ⭐⭐⭐ Advanced ⏱️ 10 minutes

😫 The Pain Point

HR sends payslips every month. 100 employees -> 100 emails. 100 attachments. If you send the wrong file to the wrong person, it’s a huge privacy breach. Doing it manually is high-risk.

🚀 Agentic Solution

The Dispatcher: Matches “Employee ID” in the Excel list with “Employee ID” in the filename. Guaranteed accuracy.

Key Features:

  • Personalized: “Dear [Name]” in the body.
  • Attachment Match: Auto-attaches [EmpID].pdf.
  • Private: Uses SMTP (Gmail/Outlook) directly from your machine.

⚔️ Phase 1: Commander (Quick Fix)

For sending general notifications.

Prompt:

“I have list.csv with emails. Write a script to send a generic email ‘Monthly Update’ to everyone in the list. Use my Gmail account (I will provide App Password).”

Result: Bulk sender script.

🏗️ Phase 2: Architect (Permanent Tool)

For HR Managers.

Engineering Prompt:

**Role:** Python Automation Developer
**Task:** Create a "Secure Payroll Emailer".
**Requirements:**
1.  **GUI:**
    *   Input: Excel List (Name, Email, EmpCode).
    *   Input: Folder containing PDFs (Filename: `[EmpCode].pdf`).
    *   Config: SMTP Settings, Subject, Body Template.
    *   "Send All" button.
2.  **Logic:**
    *   Loop through employees.
    *   Find matching PDF in folder.
    *   Construct email with attachment.
    *   Send via `smtplib`.
    *   **Safety:** 2-second delay between emails.
3.  **Deliverables:** `payroll_sender.py`, `run.bat` (Windows), `run.sh` (Mac).

🧠 Prompt Decoding

  • App Password: You can’t use your normal Gmail password for scripts. You need an “App Password”. This is a security feature by Google. The prompt accounts for this configuration.

🛠️ Instructions

  1. Prepare PDF Folder (Name = ID).
  2. Copy Prompt -> Paste -> Run.
  3. Enter Credentials -> Send.

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.