Phase 2 part 7: the end of the funnel
Posts can be written for a buying signal: the prompt gets its hypothesis and angle, and links carry its campaign tag. Plausible (Stats API v2) is read once a day for visitors on tagged links, recorded per signal as Visited. Stripe (restricted key) is read every hour: $0 checkouts are Signed up, paid invoices and one-time payments are Paid with their value, tied to a signal by the checkout's utm_campaign metadata or the payer's email. The Core's Cal.com has no API, so booking emails from Cal.com in the outreach mailbox count as Booked. New Settings → Website & sales; the signal page lists its posts and tagged links. Schema 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,9 @@ type Settings struct {
|
||||
SchedulingLink string `json:"scheduling_link"` // offered as the next step, if set
|
||||
SaveToSent bool `json:"save_to_sent"` // put a copy in the mailbox's Sent folder
|
||||
ReadReplies bool `json:"read_replies"`
|
||||
// BookingFrom is the address Cal.com sends booking notices from; its
|
||||
// emails in the inbox count as bookings.
|
||||
BookingFrom string `json:"booking_from"`
|
||||
|
||||
// Insecure allows a mail server without TLS. Only tests set it.
|
||||
Insecure bool `json:"-"`
|
||||
@@ -94,13 +97,15 @@ func Save(d *db.DB, s Settings) error {
|
||||
|
||||
// Check finds settings that can't work.
|
||||
func (s *Settings) Check() error {
|
||||
for _, f := range []*string{&s.SMTPHost, &s.IMAPHost, &s.Username, &s.FromName, &s.FromAddress, &s.SchedulingLink} {
|
||||
for _, f := range []*string{&s.SMTPHost, &s.IMAPHost, &s.Username, &s.FromName, &s.FromAddress, &s.SchedulingLink, &s.BookingFrom} {
|
||||
*f = strings.TrimSpace(*f)
|
||||
}
|
||||
s.FromAddress = strings.ToLower(s.FromAddress)
|
||||
s.FromAddress, s.BookingFrom = strings.ToLower(s.FromAddress), strings.ToLower(s.BookingFrom)
|
||||
switch {
|
||||
case s.FromAddress != "" && !strings.Contains(s.FromAddress, "@"):
|
||||
return errors.New("the From address isn't an email address")
|
||||
case s.BookingFrom != "" && !strings.Contains(s.BookingFrom, "@"):
|
||||
return errors.New("Cal.com's sending address isn't an email address")
|
||||
case s.SMTPPort < 1 || s.SMTPPort > 65535 || s.IMAPPort < 1 || s.IMAPPort > 65535:
|
||||
return errors.New("a port must be between 1 and 65535")
|
||||
case s.DailyLimit < 1 || s.DailyLimit > 200:
|
||||
|
||||
Reference in New Issue
Block a user