# Build a Support Ticket System in Lovable

- Tool: Lovable Prompts
- Last updated: June 2026

## TL;DR

Paste the starter prompt into Lovable Agent Mode and get a working support ticket system: customer submission portal, agent inbox with status workflow, threaded messages with internal notes, requester-isolation RLS so customers never see each other's tickets, sequential ticket numbers, and email notifications via Resend. Full build takes roughly one day. Expected credit burn: 100-180 on a Pro $25/mo plan.

## Frequently asked questions

### Why do I need OR is_agent() in the tickets RLS policy?

Because agents are not requesters. The tickets table stores requester_id as the customer who submitted the ticket. When an agent signs in, auth.uid() returns the agent's user ID — which does not match any requester_id (agents don't submit tickets as customers). Without OR is_agent(), the SELECT policy USING (requester_id = auth.uid()) returns zero rows for every agent because no ticket has the agent as the requester. The fix is a SECURITY DEFINER plpgsql function that reads JWT app_metadata.role and returns true for 'agent' and 'admin' — then the combined USING (requester_id = auth.uid() OR is_agent()) gives customers their own tickets and agents all tickets.

### Can I really replace Zendesk with a Lovable build?

For 1-5 agents and under 100 tickets/day: yes, with this kit you can match 80% of what Zendesk offers at a fraction of the cost. What you get: ticket submission portal, threaded messages, internal notes, status workflow, SLA tracking, email in/out, basic AI triage, and a reports dashboard. What Zendesk has that this kit does not: omnichannel (SMS, Twitter/X, Messenger), advanced automation rules engine, skill-based routing, brand-specific portals, SOC2 Type II certification, and native phone support. For a lean B2B SaaS team or a solo founder, this kit is genuinely sufficient.

### How do customers reply via email without logging in?

The inbound email follow-up covers this. When notify-on-update sends a ticket reply notification, it prefixes the subject with [#1042] (the ticket number). When the customer clicks Reply in their email client, their reply goes to your Postmark inbound address (e.g., support@reply.yourdomain.com). Postmark parses the email and calls your inbound-email Edge Function with the raw message. The function finds the [#1042] in the subject, looks up ticket #1042, and inserts the email body as a new ticket_messages row. The customer never has to log in to reply — they just hit Reply like any normal email thread.

### What's the best free email service for this — Resend or Postmark?

For outbound only (notifications, acknowledgments): Resend. 3K free emails per month, excellent deliverability, simple API. For inbound parsing (customers replying by email): Postmark. Postmark's inbound email parser handles Reply-To headers, threaded conversation detection, signature stripping, and MIME-encoded attachments far better than a DIY regex parser. They offer 1K free inbound messages per month. Use both: Resend for outbound, Postmark for inbound. The total cost is $0 at low volume and about $15-35/mo once you scale past free tiers.

### Should I add AI triage from day one?

Not from day one — add it once you have at least 20 tickets so you can validate the AI's classifications against real data. Claude Haiku 4.5 classifies tickets well for common categories (Billing, Technical, Account) but needs prompt tuning for your specific product context. The AI triage follow-up (follow-up #6) takes about 80 credits to wire correctly. Until then, manual triage is fine and you'll learn what classification rules make sense for your support volume before baking them into a prompt.

### How do I migrate existing Zendesk tickets to this system?

Export your Zendesk data via Zendesk Admin → Reporting → Data Export (XML or JSON). Write a one-time import script (a Supabase Edge Function works well) that reads the export and inserts rows into tickets and ticket_messages. Key mappings: Zendesk ticket ID maps to a new ticket_number (start your tickets_seq above your highest Zendesk ID to avoid collisions), Zendesk requester email maps to auth.users/profiles by email, Zendesk comments map to ticket_messages with is_internal_note for Zendesk private comments. Test with a small subset first. Note that Zendesk attachments are separate — you'll need to download and re-upload each one to your ticket-attachments Storage bucket.

### When does it make sense to keep Zendesk instead of building?

If your build outgrows this prompt kit and you need custom architecture, RapidDev builds production-grade Lovable apps at $13K-$25K — book a free 30-minute consultation at rapidevelopers.com.

---

Source: https://www.rapidevelopers.com/lovable-prompts/lovable-prompts-for-building-support-ticket-system
© RapidDev — https://www.rapidevelopers.com/lovable-prompts/lovable-prompts-for-building-support-ticket-system
