Prospects: Listmonk mailing lists, and their opt-outs

Settings → Email → Mailing lists connects Listmonk (the Core's, by
default) with an API user and its token; Test reads the lists. A person
in Review can be added to a list, with their company, title and signal:
a double opt-in list asks them to confirm unless they already agreed; a
single opt-in list takes them only once they have; a suppressed address
is refused. Their card shows the lists they're on (a new list_members
table). Every hour, or on Sync now, everyone blocklisted in Listmonk or
unsubscribed from one of its lists goes on the suppression list, with
the reason; an address already there keeps its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-24 13:15:37 -07:00
co-authored by Claude Opus 5.5
parent a81ced3503
commit b6758417a3
14 changed files with 903 additions and 20 deletions
+24 -20
View File
@@ -137,26 +137,28 @@ func (s *Server) renderProspects(w http.ResponseWriter, r *http.Request, tab str
}
}
s.render(w, r, "prospects", page{Title: "Review prospects", Nav: "prospects/review", Error: errMsg, Data: map[string]any{
"Tab": tab,
"Statuses": prospects.Statuses,
"Counts": counts,
"Companies": companies,
"Loose": loose,
"Matches": matches,
"Synced": sync.Last,
"Signals": list,
"SignalNames": names,
"Signal": signalID,
"Events": events,
"Stages": signals.Stages[1:], // found is recorded on its own
"Channels": signals.Channels,
"Back": reviewURL(tab, signalID),
"Today": time.Now().Format("2006-01-02"),
"Hunter": s.Secrets.Has(secrets.HunterAPIKey),
"Runs": runs,
"Messages": messages,
"Unverified": len(unverified(companies, loose)),
"MaxVerify": maxVerify,
"Tab": tab,
"Statuses": prospects.Statuses,
"Counts": counts,
"Companies": companies,
"Loose": loose,
"Matches": matches,
"Synced": sync.Last,
"Signals": list,
"SignalNames": names,
"Signal": signalID,
"Events": events,
"Stages": signals.Stages[1:], // found is recorded on its own
"MailingLists": s.reviewLists(r),
"OnLists": s.onLists(),
"Channels": signals.Channels,
"Back": reviewURL(tab, signalID),
"Today": time.Now().Format("2006-01-02"),
"Hunter": s.Secrets.Has(secrets.HunterAPIKey),
"Runs": runs,
"Messages": messages,
"Unverified": len(unverified(companies, loose)),
"MaxVerify": maxVerify,
}})
}
@@ -197,6 +199,8 @@ func (s *Server) prospectAction(w http.ResponseWriter, r *http.Request) {
if action == "verify" {
msg = "verified"
}
case "contact/list":
err, msg = s.addToList(r, id), "listed"
case "company/delete", "contact/delete":
err, msg = prospects.Delete(s.DB, kind, id), "deleted"
case "company/reconsider", "contact/reconsider":