Schema 7 adds signals (hypothesis, how to spot it, angle, status, utm slug), funnel_events (stage, channel, subject, campaign, source, deduped by external ID) and outside_campaigns. Prospects -> Signals is the scorecard: each signal's funnel from found to paid, people once per stage, with revenue and outside spend, by period and channel. Each signal's page shows its funnel by channel, its campaigns and its latest steps. Prospects carry a signal (filter, change, "found" recorded) and outcomes can be recorded by hand. Settings -> Lead sources holds origami.chat and explee.com API keys. Every 6 hours (or Import now) Supermarket reads their campaigns, numbers and spend, contacted people, replies and hot leads, read-only: interested people and repliers become prospects, unsubscribes are suppressed, and each campaign is assigned to a signal. The explee.com client follows its OpenAPI schema; origami.chat's responses are undocumented, so its client reads fields loosely and its Test shows the real response. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
174 lines
11 KiB
HTML
174 lines
11 KiB
HTML
{{define "content"}}{{with .Data}}{{$tab := .Tab}}{{$matches := .Matches}}{{$d := .}}
|
|
<div class="heading">
|
|
<h1>Review prospects</h1>
|
|
<div class="buttons">
|
|
<a class="button" href="/prospects/new{{if .Signal}}?signal={{.Signal}}{{end}}">Add a prospect</a>
|
|
</div>
|
|
</div>
|
|
<p class="lede">Companies and people who may fit your targets. Nothing goes to your CRM until you accept it: accepting a company adds an Account, accepting a person adds a Lead, through <a href="/crm">the CRM queue</a>. Each one keeps where and when it was found.</p>
|
|
|
|
{{if .Signals}}
|
|
<form method="get" action="/prospects" class="filters">
|
|
<input type="hidden" name="status" value="{{$tab}}">
|
|
<label class="small">Signal
|
|
<select name="signal" data-autosubmit>
|
|
<option value="0">All signals</option>
|
|
{{range .Signals}}<option value="{{.ID}}" {{if eq .ID $d.Signal}}selected{{end}}>{{.Name}}</option>{{end}}
|
|
</select>
|
|
</label>
|
|
<noscript><button type="submit" class="secondary small">Show</button></noscript>
|
|
</form>
|
|
{{end}}
|
|
|
|
<nav class="tabs">
|
|
{{range .Statuses}}<a href="/prospects?status={{.}}{{if $d.Signal}}&signal={{$d.Signal}}{{end}}" {{if eq $tab .}}aria-current="page"{{end}}>{{if eq . "new"}}New{{else if eq . "accepted"}}Accepted{{else}}Set aside{{end}}{{with index $.Data.Counts .}} <span class="muted">{{.}}</span>{{end}}</a>{{end}}
|
|
</nav>
|
|
|
|
{{if and (eq $tab "new") (or .Companies .Loose)}}
|
|
<p class="help">{{if .Synced.IsZero}}Your CRM hasn't been synced yet, so Supermarket can't warn you about records you already have.{{else}}Checked against your CRM as of {{ago .Synced}}.{{end}}</p>
|
|
{{end}}
|
|
|
|
{{range .Companies}}{{$c := .}}
|
|
<section class="card prospect">
|
|
<div class="prospect-head">
|
|
<div>
|
|
<h2>{{.Name}}{{if ne .Status $tab}} <span class="badge">{{template "prospect-status" .Status}}</span>{{end}}</h2>
|
|
<p class="meta">
|
|
{{with .Website}}<a href="{{.}}" target="_blank" rel="noopener noreferrer">{{$c.Domain}}</a>{{end}}
|
|
{{with .Industry}} · {{.}}{{end}}{{with .Size}} · {{.}}{{end}}{{with .Location}} · {{.}}{{end}}
|
|
{{with .LinkedIn}} · <a href="{{.}}" target="_blank" rel="noopener noreferrer">LinkedIn</a>{{end}}
|
|
</p>
|
|
</div>
|
|
{{if eq .Status $tab}}
|
|
<div class="row-actions">
|
|
{{if eq $tab "new"}}
|
|
{{if .Contacts}}<form method="post" action="/prospects/company/{{.ID}}/accept-all"><input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}"><button type="submit" class="small">Accept with {{len .Contacts}} {{if eq (len .Contacts) 1}}person{{else}}people{{end}}</button></form>{{end}}
|
|
<form method="post" action="/prospects/company/{{.ID}}/accept"><input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}"><button type="submit" class="small {{if .Contacts}}secondary{{end}}">Accept {{if .Contacts}}company only{{else}}company{{end}}</button></form>
|
|
<form method="post" action="/prospects/company/{{.ID}}/reject"><input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}"><button type="submit" class="secondary small">Set aside</button></form>
|
|
{{if .Domain}}<form method="post" action="/prospects/company/{{.ID}}/suppress" data-confirm="Never add anyone at {{.Domain}}? This puts the domain on your suppression list."><input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}"><button type="submit" class="secondary small">Suppress {{.Domain}}</button></form>{{end}}
|
|
{{else if eq $tab "accepted"}}
|
|
{{template "crm-state" dict "CRM" .CRM "Kind" "company" "ID" .ID "Tab" $tab "Filter" $d.Signal}}
|
|
{{else}}
|
|
<form method="post" action="/prospects/company/{{.ID}}/reconsider"><input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}"><button type="submit" class="secondary small">Reconsider</button></form>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{with .Why}}<p class="why">{{.}}</p>{{end}}
|
|
<p class="meta">{{template "provenance" .}}</p>
|
|
{{template "signal-tag" dict "Kind" "company" "ID" .ID "SignalID" .SignalID "D" $d}}
|
|
{{with index $matches (printf "company:%d" .ID)}}{{template "crm-matches" .}}{{end}}
|
|
|
|
{{if .Contacts}}
|
|
<ul class="items people">
|
|
{{range .Contacts}}{{template "contact" dict "P" . "Tab" $tab "Matches" $matches "D" $d}}{{end}}
|
|
</ul>
|
|
{{end}}
|
|
{{if eq $tab "new"}}<p class="small"><a href="/prospects/new?company={{.ID}}">Add a person at {{.Name}}</a></p>{{end}}
|
|
</section>
|
|
{{end}}
|
|
|
|
{{if .Loose}}
|
|
<section class="card prospect">
|
|
<h2>People without a company</h2>
|
|
<ul class="items people">
|
|
{{range .Loose}}{{template "contact" dict "P" . "Tab" $tab "Matches" $matches "D" $d}}{{end}}
|
|
</ul>
|
|
</section>
|
|
{{end}}
|
|
|
|
{{if not (or .Companies .Loose)}}
|
|
<section class="card empty">
|
|
{{if eq $tab "new"}}<p>Nothing to review. <a href="/prospects/new">Add a prospect</a> by hand; finding them for you comes next.</p>
|
|
{{else if eq $tab "accepted"}}<p>Nothing accepted yet.</p>
|
|
{{else}}<p>Nothing set aside.</p>{{end}}
|
|
</section>
|
|
{{end}}
|
|
{{end}}{{end}}
|
|
|
|
{{define "contact"}}{{$p := .P}}{{$tab := .Tab}}{{$d := .D}}
|
|
<li class="item">
|
|
<div class="prospect-head">
|
|
<div>
|
|
<strong>{{$p.Name}}</strong>{{with $p.Title}} · {{.}}{{end}}{{if ne $p.Status $tab}} <span class="badge">{{template "prospect-status" $p.Status}}</span>{{end}}
|
|
<div class="meta">
|
|
{{with $p.Email}}<a href="mailto:{{.}}">{{.}}</a>{{if eq $p.EmailStatus "valid"}} <span class="badge published">verified</span>{{else if eq $p.EmailStatus "risky"}} <span class="badge">risky</span>{{else if eq $p.EmailStatus "invalid"}} <span class="badge failed">bounces</span>{{else}} <span class="muted">not verified</span>{{end}}{{end}}
|
|
{{with $p.Phone}} · {{.}}{{end}}
|
|
{{with $p.LinkedIn}} · <a href="{{.}}" target="_blank" rel="noopener noreferrer">LinkedIn</a>{{end}}
|
|
</div>
|
|
<div class="meta">{{template "provenance" $p}}</div>
|
|
{{if not $p.CompanyID}}{{template "signal-tag" dict "Kind" "contact" "ID" $p.ID "SignalID" $p.SignalID "D" $d}}{{end}}
|
|
{{with index .Matches (printf "contact:%d" $p.ID)}}{{template "crm-matches" .}}{{end}}
|
|
{{template "outcomes" dict "Kind" "contact" "ID" $p.ID "Tab" $tab "D" $d}}
|
|
</div>
|
|
{{if eq $p.Status $tab}}
|
|
<div class="row-actions">
|
|
{{if eq $tab "new"}}
|
|
<form method="post" action="/prospects/contact/{{$p.ID}}/accept"><input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}"><button type="submit" class="small">Accept</button></form>
|
|
<form method="post" action="/prospects/contact/{{$p.ID}}/reject"><input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}"><button type="submit" class="secondary small">Set aside</button></form>
|
|
{{if $p.Email}}<form method="post" action="/prospects/contact/{{$p.ID}}/suppress" data-confirm="Never add {{$p.Email}}? This puts the address on your suppression list."><input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}"><button type="submit" class="secondary small">Suppress</button></form>{{end}}
|
|
{{else if eq $tab "accepted"}}
|
|
{{template "crm-state" dict "CRM" $p.CRM "Kind" "contact" "ID" $p.ID "Tab" $tab "Filter" $d.Signal}}
|
|
{{else}}
|
|
<form method="post" action="/prospects/contact/{{$p.ID}}/reconsider"><input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}"><button type="submit" class="secondary small">Reconsider</button></form>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</li>
|
|
{{end}}
|
|
|
|
{{define "prospect-status"}}{{if eq . "new"}}new{{else if eq . "accepted"}}accepted{{else}}set aside{{end}}{{end}}
|
|
|
|
{{define "provenance"}}{{if eq .Source "manual"}}Added by hand{{else}}Found by {{.Source}}{{end}} {{ago .FoundAt}}{{with .SourceDetail}} · {{if or (hasPrefix . "https://") (hasPrefix . "http://")}}<a href="{{.}}" target="_blank" rel="noopener noreferrer">source</a>{{else}}{{.}}{{end}}{{end}}{{end}}
|
|
|
|
{{define "crm-matches"}}
|
|
<p class="warnings">Already in your CRM: {{range $i, $r := .}}{{if $i}}, {{end}}{{$r.Entity}} <strong>{{$r.Name}}</strong>{{with $r.Email}} ({{.}}){{end}}{{end}}.</p>
|
|
{{end}}
|
|
|
|
{{define "crm-state"}}
|
|
{{if eq .CRM.Status "done"}}<span class="badge published">{{if eq .CRM.Outcome "existing"}}already in the CRM{{else}}in the CRM{{end}}</span>
|
|
{{else if eq .CRM.Status "failed"}}<span class="badge failed">failed</span> <a class="small" href="/crm">CRM queue</a>
|
|
{{else if eq .CRM.Status "cancelled"}}<span class="badge">cancelled</span>
|
|
<form method="post" action="/prospects/{{.Kind}}/{{.ID}}/accept"><input type="hidden" name="tab" value="{{.Tab}}"><input type="hidden" name="filter" value="{{.Filter}}"><button type="submit" class="secondary small">Queue again</button></form>
|
|
{{else if eq .CRM.Status "claimed"}}<span class="badge scheduled">with Hermes</span>
|
|
{{else if .CRM.Status}}<span class="badge draft">waiting for Hermes</span>
|
|
{{else}}<span class="badge">accepted</span>{{end}}
|
|
{{end}}
|
|
|
|
{{define "signal-tag"}}{{$d := .D}}{{$cur := .SignalID}}
|
|
{{if $d.Signals}}
|
|
<form method="post" action="/prospects/{{.Kind}}/{{.ID}}/signal" class="signal-tag">
|
|
<input type="hidden" name="tab" value="{{$d.Tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}">
|
|
<label class="small">Signal
|
|
<select name="signal" data-autosubmit>
|
|
<option value="0">none</option>
|
|
{{range $d.Signals}}<option value="{{.ID}}" {{if eq .ID $cur}}selected{{end}}>{{.Name}}</option>{{end}}
|
|
</select>
|
|
</label>
|
|
<noscript><button type="submit" class="secondary small">Save</button></noscript>
|
|
</form>
|
|
{{end}}
|
|
{{end}}
|
|
|
|
{{define "outcomes"}}{{$d := .D}}{{$subject := printf "%s:%d" .Kind .ID}}
|
|
{{with index $d.Events $subject}}
|
|
<ol class="steps-done">
|
|
{{range .}}<li><span class="badge {{if eq .Stage "paid"}}published{{else}}draft{{end}}">{{stage .Stage}}</span> {{channel .Channel}} · {{ago .At}}{{if .ValueCents}} · {{money .ValueCents}}{{end}}{{with .Note}} · {{truncate 100 .}}{{end}}
|
|
{{if eq .Source "manual"}}<form method="post" action="/funnel/{{.ID}}/delete" class="inline" data-confirm="Remove this step?"><input type="hidden" name="back" value="{{$d.Back}}"><input type="hidden" name="tab" value="{{$d.Tab}}"><button type="submit" class="link small">remove</button></form>{{end}}</li>{{end}}
|
|
</ol>
|
|
{{end}}
|
|
<details class="outcome">
|
|
<summary class="small">Record an outcome</summary>
|
|
<form method="post" action="/prospects/{{.Kind}}/{{.ID}}/outcome" class="row wrap">
|
|
<input type="hidden" name="tab" value="{{.Tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}">
|
|
<label class="small">Step <select name="stage">{{range $d.Stages}}<option value="{{.ID}}">{{.Label}}</option>{{end}}</select></label>
|
|
<label class="small">Channel <select name="channel">{{range $d.Channels}}<option value="{{.ID}}">{{.Label}}</option>{{end}}</select></label>
|
|
<label class="small">Date <input type="date" name="date" value="{{$d.Today}}"></label>
|
|
<label class="small">Amount <input name="amount" inputmode="decimal" placeholder="for Paid, e.g. 70" size="8"></label>
|
|
<label class="small grow">Note <input name="note" placeholder="optional"></label>
|
|
<button type="submit" class="secondary small">Record</button>
|
|
</form>
|
|
</details>
|
|
{{end}}
|