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:
@@ -64,8 +64,39 @@
|
||||
</div>
|
||||
<div id="email-test"></div>
|
||||
</section>
|
||||
|
||||
<form method="post" action="/settings/email/listmonk" autocomplete="off">
|
||||
<section class="card" id="lists">
|
||||
<h3>Mailing lists: Listmonk</h3>
|
||||
<p class="small">Add a prospect to a newsletter or announcement list from Review (<em>Add to a mailing list</em>, on a person). Supermarket only adds people; Listmonk sends the campaigns. On a double opt-in list, Listmonk emails them to confirm unless you say they already agreed.</p>
|
||||
<div class="cols">
|
||||
<label>Listmonk's address <input name="listmonk_url" value="{{.Listmonk.URL}}" placeholder="https://listmonk.example.com"></label>
|
||||
<label>API user <input name="listmonk_user" value="{{.Listmonk.User}}" placeholder="supermarket"><span class="help">In Listmonk: Admin → Users → New, type API, with a role that can manage subscribers and read lists.</span></label>
|
||||
</div>
|
||||
{{template "key-field" (dict "F" .LMToken "Set" .LMSet)}}
|
||||
<div class="row">
|
||||
<button type="submit" class="secondary small">Save</button>
|
||||
{{if .LMSet}}<button hx-disabled-elt="this" type="button" class="secondary small" hx-post="/settings/email/listmonk/test" hx-target="#listmonk-test" hx-indicator="#testing-listmonk">Test</button>
|
||||
<span id="testing-listmonk" class="htmx-indicator">Reading the lists…</span>{{end}}
|
||||
</div>
|
||||
<div id="listmonk-test"></div>
|
||||
{{if .LMSet}}
|
||||
<div class="row">
|
||||
<button type="submit" class="secondary small" formaction="/settings/email/listmonk/sync" formnovalidate>Sync unsubscribes now</button>
|
||||
<span class="small muted">Every hour, everyone blocklisted in Listmonk or unsubscribed from one of its lists goes on your <a href="/prospects/suppressed">suppression list</a>, so they're never added as a prospect or emailed in outreach again.</span>
|
||||
</div>
|
||||
{{with .OptOuts}}<p class="small {{if .Error}}error-text{{else}}muted{{end}}">Last synced {{ago .At}}: {{if .Error}}{{.Error}}{{else}}{{.Seen}} {{if eq .Seen 1}}person doesn't{{else}}people don't{{end}} want mail; {{.Added}} new on the suppression list.{{end}}</p>{{end}}
|
||||
{{end}}
|
||||
</section>
|
||||
</form>
|
||||
{{end}}{{template "settings-end"}}{{end}}
|
||||
|
||||
{{define "email-test"}}
|
||||
<ul class="checks">{{range .}}<li class="{{if .OK}}ok{{else}}bad{{end}}">{{.Text}}</li>{{end}}</ul>
|
||||
{{end}}
|
||||
|
||||
{{define "listmonk-test"}}
|
||||
{{with .Error}}<ul class="checks"><li class="bad">{{.}}</li></ul>
|
||||
{{else}}<ul class="checks"><li class="ok">It works: {{len .Lists}} {{if eq (len .Lists) 1}}list{{else}}lists{{end}}.</li></ul>
|
||||
<ul class="small">{{range .Lists}}<li>{{.Name}} · {{.Type}}, {{if .Double}}double opt-in{{else}}single opt-in{{end}} · {{.Subscribers}} subscribers</li>{{end}}</ul>{{end}}
|
||||
{{end}}
|
||||
|
||||
@@ -130,6 +130,7 @@
|
||||
{{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}}
|
||||
{{template "mailing" dict "P" $p "Tab" $tab "D" $d}}
|
||||
</div>
|
||||
{{if eq $p.Status $tab}}
|
||||
<div class="row-actions">
|
||||
@@ -204,3 +205,19 @@
|
||||
</form>
|
||||
</details>
|
||||
{{end}}
|
||||
|
||||
{{define "mailing"}}{{$d := .D}}{{$p := .P}}
|
||||
{{with index $d.OnLists $p.ID}}<p class="small muted">On {{range $i, $m := .}}{{if $i}}, {{end}}<strong>{{$m.List}}</strong>{{if not $m.Confirmed}} (asked to confirm){{end}} since {{ago $m.At}}{{end}}.</p>{{end}}
|
||||
{{if and $d.MailingLists $p.Email}}
|
||||
<details class="outcome">
|
||||
<summary class="small">Add to a mailing list</summary>
|
||||
<form method="post" action="/prospects/contact/{{$p.ID}}/list" class="row wrap">
|
||||
<input type="hidden" name="tab" value="{{.Tab}}"><input type="hidden" name="filter" value="{{$d.Signal}}">
|
||||
<label class="small">List <select name="list">{{range $d.MailingLists}}<option value="{{.ID}}">{{.Name}}{{if .Double}} (double opt-in){{else}} (single opt-in){{end}}</option>{{end}}</select></label>
|
||||
<label class="check small"><input type="checkbox" name="agreed"> They agreed to receive it</label>
|
||||
<button type="submit" class="secondary small">Add</button>
|
||||
</form>
|
||||
<p class="small muted">Without their agreement, only a double opt-in list takes them: Listmonk asks them to confirm, and they get nothing until they do. A single opt-in list sends its mail straight away, so it needs their agreement.</p>
|
||||
</details>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user