Phase 2 part 6: outreach by email and LinkedIn

Drafts are written by the AI from the person's buying signal (hypothesis
and angle), their company and their history, then reviewed and edited.
Queued emails go out through the Core's mail server one at a time, within
the sending hours, the daily limit and a gap, never to a suppressed or
bouncing address or someone emailed in the last 14 days; with a signature,
an opt-out line, UTM-tagged links and a copy in Sent. The inbox is read
read-only every 10 minutes: replies (by Message-ID or sender) count as
Replied, bounces mark the address, and "stop" replies are suppressed.
LinkedIn messages are copied, sent by hand and marked sent. New pages:
Prospects → Outreach and Settings → Email (with an SMTP, IMAP, SPF, DKIM
and DMARC check). Schema 10; emersion/go-imap for IMAP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 06:09:47 -07:00
co-authored by Claude Opus 5.5
parent 82d569da9c
commit c2772a7927
26 changed files with 3079 additions and 3 deletions
+21 -1
View File
@@ -602,7 +602,27 @@ data. Each becomes an adapter behind a `leadsource` interface.
spend for CAC (Hunter.io bills by plan, not per credit).
6. **Direct outreach**: email through the Core's mail server (drafted,
reviewed, sent, replies read over IMAP) and LinkedIn by hand; each
outcome recorded in the funnel.
outcome recorded in the funnel. **Built 2026-11-22** (schema 10):
`internal/outreach` and the `outreach` table. Drafts come from the AI
(task "outreach") with the signal's hypothesis and angle, the person,
their company and their history. The queue sends one email at a time
(net/smtp, STARTTLS on 587 or TLS on 465) within the sending hours, the
daily limit and a gap. Before each send it checks the suppression list,
bouncing addresses, and anyone emailed in the last 14 days. Emails are
plain text with the signature, an opt-out line, `List-Unsubscribe`,
UTM-tagged links to our sites (utm_campaign = the signal) and a
Message-ID kept for matching replies; a copy goes to Sent via IMAP
APPEND. The inbox is read every 10 minutes with emersion/go-imap,
read-only (EXAMINE, BODY.PEEK), from the last UID. A reply is matched
by In-Reply-To/References, or else by sender. Out-of-office replies are
skipped. Bounces mark the address invalid. "Stop" replies go on the
suppression list. LinkedIn messages are copied and sent by hand, then
marked sent and replied. Sent counts as Contacted and a reply as Replied.
Settings → Email has the mailbox (password in `secrets.json`), the
limits, the signature, an optional scheduling link, and a check (SMTP
and IMAP sign-in, SPF, DKIM at common selectors, DMARC). Follow-up
sequences aren't automatic yet: a second draft to the same person is
written as a follow-up, and can go after 14 days.
7. **Indirect and the end of the funnel**: content drafts tagged with a
signal (UTM per signal), Plausible results per signal, Cal.com bookings,
and Stripe sign-ups and payments (pulled forward from Phase 4's Stripe