Phase 2 part 5: find people and verify emails with Hunter.io

Review gets Find people (Domain Search by the departments, seniority and
count set in Settings → Lead sources), Find their email (Email Finder for
a named person at a company), and Verify (one, or every unchecked address
in New). Every call is kept in enrich_runs (schema 9) with its result and
credits, and shown on the card. Nothing runs on a schedule. Sources are
shown by name (Hunter.io, origami.chat, explee.com).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 05:53:52 -07:00
co-authored by Claude Opus 5.5
parent efca73bcd4
commit 82d569da9c
18 changed files with 1348 additions and 11 deletions
+26 -2
View File
@@ -25,6 +25,13 @@
</nav>
{{if and (eq $tab "new") (or .Companies .Loose)}}
{{if and .Hunter .Unverified}}
<form method="post" action="/prospects/verify" class="inline-note" data-busy="Verifying…">
<input type="hidden" name="filter" value="{{.Signal}}">
<span class="small">{{.Unverified}} {{if eq .Unverified 1}}address hasn't{{else}}addresses haven't{{end}} been verified{{if gt .Unverified .MaxVerify}} ({{.MaxVerify}} are checked at a time){{end}}.</span>
<button type="submit" class="secondary small">Verify with Hunter.io</button>
</form>
{{end}}
<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}}
@@ -56,6 +63,13 @@
</div>
{{with .Why}}<p class="why">{{.}}</p>{{end}}
<p class="meta">{{template "provenance" .}}</p>
{{if and $d.Hunter .Domain (ne .Status "rejected")}}
<form method="post" action="/prospects/company/{{.ID}}/people" class="inline-note" data-busy="Searching Hunter.io…">
<input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}">
<button type="submit" class="secondary small">Find people at {{.Domain}}</button>
{{template "enrich-run" (index $d.Runs (printf "company:%d" .ID))}}
</form>
{{else}}{{template "enrich-run" (index $d.Runs (printf "company:%d" .ID))}}{{end}}
{{template "signal-tag" dict "Kind" "company" "ID" .ID "SignalID" .SignalID "D" $d}}
{{with index $matches (printf "company:%d" .ID)}}{{template "crm-matches" .}}{{end}}
@@ -92,11 +106,19 @@
<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.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 if eq $p.EmailStatus "unknown"}} <span class="muted">couldn't be verified</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 and $d.Hunter (ne $p.Status "rejected")}}
{{if and (not $p.Email) $p.CompanyID}}
<form method="post" action="/prospects/contact/{{$p.ID}}/find-email" class="inline-note" data-busy="Searching Hunter.io…"><input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}"><button type="submit" class="link small">Find their email</button></form>
{{else if and $p.Email (not $p.EmailStatus)}}
<form method="post" action="/prospects/contact/{{$p.ID}}/verify" class="inline-note" data-busy="Verifying…"><input type="hidden" name="tab" value="{{$tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}"><button type="submit" class="link small">Verify the address</button></form>
{{end}}
{{end}}
{{template "enrich-run" (index $d.Runs (printf "contact:%d" $p.ID))}}
{{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}}
@@ -120,7 +142,9 @@
{{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 "enrich-run"}}{{if .ID}}<span class="small {{if .Error}}error-text{{else}}muted{{end}}">Hunter.io {{ago .At}}: {{if .Error}}{{.Error}}{{else}}{{.Result}}{{end}}{{if .Credits}} ({{.Credits}} {{if eq .Credits 1.0}}credit{{else}}credits{{end}}){{end}}</span>{{end}}{{end}}
{{define "provenance"}}{{if eq .Source "manual"}}Added by hand{{else}}Found by {{sourceLabel .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>