Phase 2 part 2: prospects, the review screen and the suppression list

Schema 6 adds prospect_companies, prospect_contacts (merged by domain and
email, each with its source, detail and date) and suppressions. Prospects
-> Review lists New, Accepted and Set aside: accepting a company queues an
EspoCRM Account, a person a Lead at their company, with provenance and
why they fit in the description; the page warns about records already in
the CRM as of the last sync, and shows each accepted prospect's CRM
progress. Prospects can be added by hand. The suppression list (emails
and domains) is checked on add and again before queueing, and suppressing
sets matching new prospects aside. Search finds prospects too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 16:51:05 -07:00
co-authored by Claude Opus 5.5
parent 1dc5476d43
commit 7633697567
14 changed files with 1667 additions and 5 deletions
+21 -2
View File
@@ -127,6 +127,12 @@ func (s *Server) Handler() (http.Handler, error) {
mux.HandleFunc("POST /drafts/{id}/{action}", s.draftAction)
mux.HandleFunc("POST /reddit/rules/{name}", s.refreshRules)
mux.HandleFunc("GET /prospects", s.prospectsPage)
mux.HandleFunc("GET /prospects/new", s.prospectForm)
mux.HandleFunc("POST /prospects/new", s.prospectAdd)
mux.HandleFunc("GET /prospects/suppressed", s.suppressedPage)
mux.HandleFunc("POST /prospects/suppressed", s.suppressedAction)
mux.HandleFunc("POST /prospects/{kind}/{id}/{action}", s.prospectAction)
mux.HandleFunc("GET /crm", s.crmPage)
mux.HandleFunc("GET /crm/reach", s.crmReach)
mux.HandleFunc("POST /crm/{action}", s.crmAction)
@@ -263,6 +269,8 @@ type page struct {
Data any
Inbox int // drafts waiting for review, shown in the menu
Query string // the search box's text
NewProspects int // companies and people waiting for review, shown in the menu
}
// Section is the top bar's first breadcrumb, from Nav.
@@ -290,7 +298,7 @@ type module struct {
var modules = []module{
{"content", "Content", "Phase 1", "Draft posts from partner and competitor news and your own products; review and publish to X, LinkedIn and Reddit.", "/content"},
{"prospects", "Prospects", "Phase 2", "Find companies and people who fit your targets, and add the ones you approve to EspoCRM through Hermes.", "/crm"},
{"prospects", "Prospects", "Phase 2", "Find companies and people who fit your targets, and add the ones you approve to EspoCRM through Hermes.", "/prospects"},
{"seo", "SEO", "Phase 3", "Audit your websites and open fixes as pull requests on your Hugo repositories.", ""},
{"metrics", "Metrics", "Phase 4", "Pipeline influence, CAC, CLV and NRR from Stripe, EspoCRM and Plausible.", ""},
{"sites", "Sites", "Phase 5", "Build pages and sites from a component library and publish them through Gitea.", ""},
@@ -309,6 +317,7 @@ func (s *Server) render(w http.ResponseWriter, r *http.Request, name string, p p
}
p.Version = s.Version
p.Inbox = s.inboxCount()
p.NewProspects = s.newProspects()
if p.Flash == "" {
p.Flash = flashes[r.URL.Query().Get("msg")]
}
@@ -340,6 +349,12 @@ var flashes = map[string]string{
"reddit-connected": "Reddit is connected.",
"crm-test": "Test Lead queued. Hermes creates it on its next run; or run it now (below).",
"crm-sync": "Sync requested: Hermes copies CRM records on its next run.",
"accepted": "Accepted: queued for the CRM. Hermes adds it on its next run.",
"rejected": "Set aside.",
"reconsidered": "Back in New.",
"suppressed": "Added to the suppression list.",
"unsuppressed": "Taken off the suppression list.",
"prospect-added": "Added. Review it below.",
"rules-refreshed": "Rules refreshed.",
"imported": "Imported.",
"oauth-expired": "That sign-in took too long or was already used. Try again.",
@@ -355,7 +370,11 @@ var flashes = map[string]string{
func redirect(w http.ResponseWriter, r *http.Request, path, msg string) {
if msg != "" {
path += "?msg=" + url.QueryEscape(msg)
sep := "?"
if strings.Contains(path, "?") {
sep = "&"
}
path += sep + "msg=" + url.QueryEscape(msg)
}
http.Redirect(w, r, path, http.StatusSeeOther)
}