Mailhook and MySQL: Emailed Timesheet to Database Logger Template

When a timesheet email lands at your Spojit Mailhook address, this template reads the hours and writes them straight into a MySQL table for payroll.

What It Builds

A Mailhook trigger gives the workflow its own dedicated inbound address, so any timesheet email forwarded there starts a run. A Connector node in Agent mode reads the email body, pulls out the employee name, date, and hours worked, and a second Connector node in Direct mode inserts one row per shift into your MySQL timesheet table. The result is a clean, queryable payroll log built from plain email.

The Prompt

Paste this into Miraxa and it builds the workflow, connecting the tools for you:

Build a workflow with a Mailhook trigger so timesheet emails sent to a dedicated address kick it off. Read the email body and extract the employee name, work date, and hours worked, then insert each entry as a new row into the "timesheets" table in my MySQL database.

Connectors Used

  • Mailhook trigger - the dedicated inbound email address that starts each run.
  • MySQL - inserts the parsed hours as rows in your payroll table.

Customize It

Change the table name from timesheets to match your schema, and tell the prompt which columns to map (for example employee, shift_date, hours, and a pay_period). You can also ask it to skip emails that are missing a date or to round hours to two decimals before inserting.

Tips

  • Use Agent mode for the parsing step so it handles varied email wording, and Direct mode for the MySQL insert so each write is exact and predictable.
  • Make sure the MySQL connection has write access to the target table.
  • Forward a real timesheet email first and check the run log before pointing your team at the Mailhook address.

Related

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.