πŸ“Š

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)

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

  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.