{{-- The lead-type form, shared by the "add" card and every "edit" dialog. Expects: $type — the row being edited, or null when adding $colours — the palette tokens a lead type may use $priorities — the priority bands, keyed by band, in ranking order --}} @php $prefix = $type ? 'l' . $type->id . '_' : 'new_'; $priorities = $priorities ?? \App\Models\LeadType::priorityDefinitions(); $margin = \App\Models\LeadType::CONFIDENCE_MARGIN; $currentPriority = $type ? $type->priorityBand() : old('priority', \App\Models\LeadType::PRIORITY_MEDIUM); @endphp
Shown in the Lead column and the Leads menu. Name the buying signal, not the product.
The exact word the AI returns and the mail is stored with. Lowercase letters, digits and underscores.
Sent to the AI word for word. Say what separates this type from the ones next to it — this text is the whole of what the classifier knows about it. Naming what it is not helps: a vendor quoting you is not a pricing request.
/ 100
The classifier rates its own certainty out of 100. A mail of this type scoring below the floor keeps its type, score and reason, but is not counted as a lead or shown in the Leads listing. Lower it for signals worth chasing on a hunch; raise it for ones that fill the list with noise. Changing it takes effect on the next run — nothing already classified is rescored.
How soon a lead of this type needs answering — the Priority column on the mail list, and the High, Medium and Low listings in the Leads menu. Ask what has to happen today, not how interested the sender sounds: a quotation request is High because a competitor can answer it first, while a warm enquiry that asks for nothing can wait. @if ($type) {{-- Spelled out with this type's own numbers, because the rule is easier to trust than to infer from two separate controls. --}} A mail of this type scoring under {{ \App\Models\LeadType::confidenceThresholdFor($type) }} — within {{ $margin }} of its floor of {{ (int) $type->min_score }}, so the classifier only just believed it — is shown one band lower, as {{ $priorities[\App\Models\LeadType::demote($currentPriority)]['label'] ?? 'Low' }}. @else A mail scoring within {{ $margin }} of this type's floor is shown one band lower, since the classifier only just believed it. @endif Unlike the settings above, this one applies to mail already in the inbox: priority is worked out when a mail is displayed, so changing it re-ranks everything on the next page load.
The pill on the mail list. Green reads as "money on the table", blue as "genuine interest", slate as "worth knowing about" — the colour is how the column is read at a glance.
The URL segment for this type's mail listing. Leave blank when adding and it is derived from the code. Changing it breaks any bookmark to the old one.
Comma separated. Other words that should count as this type — useful for mail already stored under an older name. Renaming a code adds the old one here for you.
is_active : old('is_active', true))>
An inactive type leaves the prompt and the Leads menu. Mail already typed with it keeps it.