Helpdesk logo

Helpdesk

Project
0
by · 8 items · 6 scripts · 1 app · 1 resource smtp

main

Data table

Migration run against the main data table when the project is imported.

helpdesk.tickets
ColumnTypeConstraints
iduuid
not nullprimary keydefault gen_random_uuid()
subjecttext
not null
requester_emailtext
not null
requester_nametext
statustext
not nulldefault 'open'::text
created_attimestamp with time zone
default now()
updated_attimestamp with time zone
default now()
last_message_attimestamp with time zone
default now()
archivedboolean
not nulldefault false
helpdesk.messages
ColumnTypeConstraints
iduuid
not nullprimary keydefault gen_random_uuid()
ticket_iduuid
not null→ helpdesk.tickets
directiontext
not null
from_emailtext
from_nametext
bodytext
not null
created_attimestamp with time zone
default now()
email_message_idtext

README

A minimal Zendesk: inbound email becomes a ticket, replies thread onto it, and agents work the queue from a dashboard app.

Windmill concepts demonstrated

  • Email trigger — mail sent to the support address opens or updates a ticket.
  • Preprocessor — normalizes messy email headers before the handler runs.
  • Raw app — the agent inbox: read threads, reply, change status.
  • Resource + variables — the SMTP account, and the address replies come from.
  • Datatables — stores tickets and their message threads.

Layout

helpdesk_inbound.ts               Email-trigger handler (preprocessor + upsert ticket)
helpdesk_inbound.email_trigger.yaml
helpdesk_list_tickets.ts          Queue, optional status filter, most recent first
helpdesk_get_ticket.ts            One ticket + its full message thread
helpdesk_reply.ts                 Agent reply over SMTP, appended to the thread
helpdesk_update_status.ts         open / pending / closed
helpdesk_set_archived.ts          Archive toggle (archived tickets leave the queue)
helpdesk_dashboard__raw_app/      Support inbox UI

How a ticket is born

  1. A customer emails support@<workspace>....
  2. The email trigger fires helpdesk_inbound; the preprocessor normalizes the message.
  3. main finds an existing thread (or opens a new ticket) and appends the message.
  4. The agent replies from the dashboard → helpdesk_reply sends over SMTP and records the outbound message on the same thread.

Try it locally

wmill script preview f/helpdesk/helpdesk_list_tickets -d '{"status":"open"}'