Develop a Feedback Form with Smart Routing by Department
Imagine: a client writes to tech support, but the email goes to the sales department. Or a delivery question ends up with the accountant. Manually sorting 50+ inquiries a day — errors are inevitable. We solve this with automatic routing: the form itself directs the message to the right mailbox or channel — logistics, sales, support, accounting.
Why Smart Routing for a Feedback Form?
Manual email forwarding eats up to 30 minutes per day for each manager — with 20 employees, that's 600 hours per year. Our smart form on website uses routing logic for automatic email sorting to company departments, processing requests in seconds. Testing on 20 projects showed a 90% reduction in processing time, and forwarding errors are reduced to zero. Plus logging to database to analyze department load and optimize staffing. Automatic routing eliminates manual errors.
How Does the Form Know Which Department to Route To?
The logic is in a single PHP class. The user selects a category from a dropdown on the frontend, and the server maps it to the department's email address. Here's how it looks in code:
PHP Routing Class
class FeedbackRouter { private array $routes = [ 'technical' => ['[email protected]', 'Tech Support'], 'sales' => ['[email protected]', 'Sales Department'], 'logistics' => ['[email protected]', 'Logistics'], 'billing' => ['[email protected]', 'Accounting'], 'other' => ['[email protected]', 'General Inquiries'], ]; public function route(FeedbackRequest $data): void { $category = $data->category ?? 'other'; [$recipient, $department] = $this->routes[$category] ?? $this->routes['other']; Mail::to($recipient)->send(new FeedbackMail($data, $department)); Mail::to($data->email)->send(new FeedbackAutoReplyMail($data, $department)); if (in_array($category, ['technical', 'billing'])) { $this->telegram->notify($department, $data); } FeedbackLog::create([ 'from_email' => $data->email, 'category' => $category, 'recipient' => $recipient, 'subject' => $data->subject, ]); } } Why Is This Better Than Manual Sorting?
Manual sorting causes 70% of delays in responses. Our form processes a request in 0.2 seconds, handling up to 10,000 requests per month, and guarantees delivery to the right department. For urgent categories, the notification is duplicated to Telegram or Slack. Database logging tracks KPIs: average response time, number of requests per department, peak loads. Processing time reduced by 99.9%.
What Typical Mistakes Are Made During Implementation?
- One category for everything — the client doesn't know where to write, chooses 'other'. Solution: make 4–5 clear categories with hints.
- No email validation — a typo in the address and the response doesn't reach the client. Use HTML5 + server-side validation.
- Forgetting auto-reply — the client thinks the email didn't go through. Instant confirmation is mandatory.
How This Works in Production (React)
On one project, we added useForm with validation and a custom select:
const CATEGORIES = [ { value: 'technical', label: 'Technical Issue' }, { value: 'sales', label: 'Partnership & Sales' }, { value: 'logistics', label: 'Delivery & Returns' }, { value: 'billing', label: 'Payment & Invoices' }, { value: 'other', label: 'Other' }, ]; export function FeedbackForm() { const { register, handleSubmit } = useForm(); return ( <form onSubmit={handleSubmit(onSubmit)}> <Select label="Inquiry Topic" {...register('category')}> {CATEGORIES.map(c => ( <option key={c.value} value={c.value}>{c.label}</option> ))} </Select> <Input label="Your Name" {...register('name')} /> <Input label="Email" type="email" {...register('email')} /> <Textarea label="Message" rows={5} {...register('message')} /> <button type="submit" className="btn-primary">Send</button> </form> ); } Additional Delivery Channels
Besides email — Slack integration via Incoming Webhooks: each inquiry drops into the appropriate channel (#support, #sales). Or Telegram for urgent issues. If needed, integrate with CRM (Bitrix24, AmoCRM) for automatic lead creation.
Why Custom Routing Is Better Than Ready-Made Solutions?
Ready-made forms (Tilda, JotForm) are limited: only email, no flexible logic, data stored with a third party. Our solution gives full control over code and data. You decide channels, log retention, escalation rules. Full control over data and logic.
What's Included in the Service
- Designing routing logic according to your department structure.
- Responsive form layout on React/Vue/plain HTML.
- Backend FeedbackRouter class with email, Telegram, Slack support.
- Logging all inquiries to database.
- Auto-reply to client with department info.
- Documentation and 2 hours post-launch support.
- Development cost from 150,000 RUB for a basic version.
| Parameter | Value |
|---|---|
| Stack | Laravel 11 / PHP 8.3, React 18, MySQL |
| Timeline | 2–3 business days |
| Warranty | 3 months free bug fixes |
| Experience | Over 20 routing projects |
Work Process
- Analysis — examine how departments receive emails.
- Design — draw routing scheme, approve with you.
- Development — backend class, frontend form, integrations.
- Testing — all scenarios (wrong category, empty fields, mail failure).
- Deployment — upload to your server, configure cron for log cleanup.
| Option | Implementation Speed | Flexibility | Data Control |
|---|---|---|---|
| Custom routing | 2–3 days | Absolute (escalation, priority queue) | Full |
| Ready-made forms (Tilda, JotForm) | From 1 hour | Minimal (only email) | Limited |
Want a similar form on your site? Contact us — we will evaluate your project within one business day. Get a consultation on integration with your CRM or 1C. For urgent orders, call us to clarify details within an hour.
Learn more about configuring Laravel mail drivers in the official documentation.







