{{define "content"}}{{with .Data}}{{$tab := .Tab}}{{$matches := .Matches}}{{$d := .}}

Review prospects

Add a prospect

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 the CRM queue. Each one keeps where and when it was found.

{{if .Signals}}
{{end}} {{if and (eq $tab "new") (or .Companies .Loose)}} {{if and .Hunter .Unverified}}
{{.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}}.
{{end}}

{{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}}

{{end}} {{range .Companies}}{{$c := .}}

{{.Name}}{{if ne .Status $tab}} {{template "prospect-status" .Status}}{{end}}

{{with .Website}}{{$c.Domain}}{{end}} {{with .Industry}} · {{.}}{{end}}{{with .Size}} · {{.}}{{end}}{{with .Location}} · {{.}}{{end}} {{with .LinkedIn}} · LinkedIn{{end}}

{{if eq .Status $tab}}
{{if eq $tab "new"}} {{if .Contacts}}
{{end}}
{{if .Domain}}
{{end}} {{else if eq $tab "accepted"}} {{template "crm-state" dict "CRM" .CRM "Kind" "company" "ID" .ID "Tab" $tab "Filter" $d.Signal}} {{else}}
{{end}}
{{end}}
{{with .Why}}

{{.}}

{{end}}

{{template "provenance" .}}

{{if and $d.Hunter .Domain (ne .Status "rejected")}}
{{template "enrich-run" (index $d.Runs (printf "company:%d" .ID))}}
{{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}} {{if .Contacts}} {{end}} {{if eq $tab "new"}}

Add a person at {{.Name}}

{{end}}
{{end}} {{if .Loose}}

People without a company

{{end}} {{if not (or .Companies .Loose)}}
{{if eq $tab "new"}}

Nothing to review. Add a prospect by hand; finding them for you comes next.

{{else if eq $tab "accepted"}}

Nothing accepted yet.

{{else}}

Nothing set aside.

{{end}}
{{end}} {{end}}{{end}} {{define "contact"}}{{$p := .P}}{{$tab := .Tab}}{{$d := .D}}
  • {{$p.Name}}{{with $p.Title}} · {{.}}{{end}}{{if ne $p.Status $tab}} {{template "prospect-status" $p.Status}}{{end}}
    {{with $p.Email}}{{.}}{{if eq $p.EmailStatus "valid"}} verified{{else if eq $p.EmailStatus "risky"}} risky{{else if eq $p.EmailStatus "invalid"}} bounces{{else if eq $p.EmailStatus "unknown"}} couldn't be verified{{else}} not verified{{end}}{{end}} {{with $p.Phone}} · {{.}}{{end}} {{with $p.LinkedIn}} · LinkedIn{{end}}
    {{template "provenance" $p}}
    {{if and $d.Hunter (ne $p.Status "rejected")}} {{if and (not $p.Email) $p.CompanyID}}
    {{else if and $p.Email (not $p.EmailStatus)}}
    {{end}} {{end}} {{template "enrich-run" (index $d.Runs (printf "contact:%d" $p.ID))}} {{with index $d.Messages $p.ID}}{{end}} {{if ne $p.Status "rejected"}}
    {{if and $p.Email (ne $p.EmailStatus "invalid")}}
    {{end}} {{if $p.LinkedIn}}
    {{end}}
    {{end}} {{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}}
    {{if eq $p.Status $tab}}
    {{if eq $tab "new"}}
    {{if $p.Email}}
    {{end}} {{else if eq $tab "accepted"}} {{template "crm-state" dict "CRM" $p.CRM "Kind" "contact" "ID" $p.ID "Tab" $tab "Filter" $d.Signal}} {{else}}
    {{end}}
    {{end}}
  • {{end}} {{define "prospect-status"}}{{if eq . "new"}}new{{else if eq . "accepted"}}accepted{{else}}set aside{{end}}{{end}} {{define "enrich-run"}}{{if .ID}}Hunter.io {{ago .At}}: {{if .Error}}{{.Error}}{{else}}{{.Result}}{{end}}{{if .Credits}} ({{.Credits}} {{if eq .Credits 1.0}}credit{{else}}credits{{end}}){{end}}{{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://")}}source{{else}}{{.}}{{end}}{{end}}{{end}} {{define "crm-matches"}}

    Already in your CRM: {{range $i, $r := .}}{{if $i}}, {{end}}{{$r.Entity}} {{$r.Name}}{{with $r.Email}} ({{.}}){{end}}{{end}}.

    {{end}} {{define "crm-state"}} {{if eq .CRM.Status "done"}}{{if eq .CRM.Outcome "existing"}}already in the CRM{{else}}in the CRM{{end}} {{else if eq .CRM.Status "failed"}}failed CRM queue {{else if eq .CRM.Status "cancelled"}}cancelled
    {{else if eq .CRM.Status "claimed"}}with Hermes {{else if .CRM.Status}}waiting for Hermes {{else}}accepted{{end}} {{end}} {{define "signal-tag"}}{{$d := .D}}{{$cur := .SignalID}} {{if $d.Signals}}
    {{end}} {{end}} {{define "outcomes"}}{{$d := .D}}{{$subject := printf "%s:%d" .Kind .ID}} {{with index $d.Events $subject}}
      {{range .}}
    1. {{stage .Stage}} {{channel .Channel}} · {{ago .At}}{{if .ValueCents}} · {{money .ValueCents}}{{end}}{{with .Note}} · {{truncate 100 .}}{{end}} {{if eq .Source "manual"}}
      {{end}}
    2. {{end}}
    {{end}}
    Record an outcome
    {{end}}