Files
supermarket/internal/web/templates/email.html
T
davidandClaude Opus 5.5 c36f786ae9 Fixes from the first round of TEST.md
SEO: a domain property (sc-domain:) covers every subdomain, so the shop,
Gitea and forum were counted as the website. What ranks, the morning
check, the Monday report, keywords, change candidates and the audit's
traffic now read only the website's own host (with or without www).
The report keeps pages worth a proposal apart from "Waiting for your
yes", explains only moves past the thresholds, and says "places up/down".

Also:
- Feed summaries drop the posts' scripts and styles.
- Spend you log can't be negative.
- Test and check buttons can't be clicked twice while they run.
- Previews show the site's web fonts and icon sprites.
- Backups are read without leaving -wal/-shm files; deleting one removes
  them, and leftovers are swept at start.
- The Overview's setup flags a CRM that Hermes can't reach.
- Import now says what came in; adding a prospect that exists says so;
  prospects can be deleted.
- Signal tags and brief addresses keep accented letters (Ü → u).
- Page errors start with a capital; clearer messages for bad uploads,
  CRM retry and cancel, keywords, and the finished audit.
- The module you're in stays unfolded in the sidebar.
- A picked keyword can be unpicked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:31:42 -07:00

72 lines
5.1 KiB
HTML

{{define "content"}}{{template "settings-start" .}}{{with .Data}}{{$s := .S}}
<h2>Email</h2>
<p class="lede">The mailbox outreach is sent from, on your Core's mail server, and the rules for sending. Every email is written for one person, reviewed by you, and sent one at a time. Supermarket reads the inbox only to find replies, bounces and requests to stop: it never marks, moves or deletes anything there.</p>
<p class="help">A mailbox used only for outreach (for example <code>hello@</code> your domain) keeps replies apart from your own mail, and keeps a complaint from touching your everyday address.</p>
<form method="post" action="/settings/email" autocomplete="off">
<section class="card">
<h3>Mailbox</h3>
<div class="cols">
<label>From name <input name="from_name" value="{{$s.FromName}}" placeholder="Pat Lee"></label>
<label>From address <input name="from_address" type="email" value="{{$s.FromAddress}}" placeholder="pat@example.com"></label>
</div>
<div class="cols">
<label>User name <input name="username" value="{{$s.Username}}" placeholder="usually the address"></label>
<div>{{template "key-field" (dict "F" .Password "Set" .Set)}}</div>
</div>
<div class="cols">
<label>Sending server (SMTP) <input name="smtp_host" value="{{$s.SMTPHost}}" placeholder="mail.example.com"></label>
<label>Port <input name="smtp_port" inputmode="numeric" value="{{$s.SMTPPort}}" size="5">
<span class="help">587 (STARTTLS) or 465 (TLS).</span></label>
</div>
<div class="cols">
<label>Reading server (IMAP) <input name="imap_host" value="{{$s.IMAPHost}}" placeholder="the same, usually"></label>
<label>Port <input name="imap_port" inputmode="numeric" value="{{$s.IMAPPort}}" size="5">
<span class="help">993 (TLS).</span></label>
</div>
<label class="check"><input type="checkbox" name="read_replies" {{if $s.ReadReplies}}checked{{end}}> Read the inbox every 10 minutes for replies, bounces and requests to stop</label>
<label class="check"><input type="checkbox" name="save_to_sent" {{if $s.SaveToSent}}checked{{end}}> Put a copy of each email in the Sent folder</label>
</section>
<section class="card">
<h3>Sending</h3>
<div class="cols">
<label>Emails a day, at most <input name="daily_limit" inputmode="numeric" value="{{$s.DailyLimit}}" size="4">
<span class="help">Start low (10 to 20) while the mailbox builds a reputation.</span></label>
<label>Minutes between emails, at least <input name="gap_minutes" inputmode="numeric" value="{{$s.GapMinutes}}" size="4"></label>
</div>
<div class="cols">
<label>Between
<select name="start_hour">{{range .Hours}}{{if lt . 24}}<option value="{{.}}" {{if eq . $s.StartHour}}selected{{end}}>{{.}}:00</option>{{end}}{{end}}</select></label>
<label>and
<select name="end_hour">{{range .Hours}}{{if gt . 0}}<option value="{{.}}" {{if eq . $s.EndHour}}selected{{end}}>{{.}}:00</option>{{end}}{{end}}</select>
<span class="help">Your local time.</span></label>
</div>
<label class="check"><input type="checkbox" name="weekends" {{if $s.Weekends}}checked{{end}}> Send on weekends too</label>
<label>Scheduling link <span class="muted small">(optional)</span> <input name="scheduling_link" value="{{$s.SchedulingLink}}" placeholder="https://cal.example.com/you/30min">
<span class="help">Offered as the next step when a call fits. Booking through it counts as Booked once Cal.com is connected.</span></label>
<label>Cal.com's sending address <span class="muted small">(optional)</span> <input name="booking_from" value="{{$s.BookingFrom}}" placeholder="the From address of Cal.com's booking emails">
<span class="help">Cal.com emails you about every booking. With its address here, each new booking email in this mailbox counts as Booked for the person who booked (cancellations and reschedules don't). Open one of those emails and copy its From address. Needs the inbox reading above.</span></label>
<label>Signature <textarea name="footer" rows="5">{{$s.Footer}}</textarea>
<span class="help">Added under every email. Keep a way to opt out: a reply of “stop” puts the address on your suppression list.</span></label>
</section>
<div class="actions"><button type="submit">Save</button></div>
</form>
<section class="card">
<h3>Check</h3>
<p class="small">Signs in to both servers and looks up your domain's SPF, DKIM and DMARC records, which decide whether outreach reaches the inbox. Nothing is sent.</p>
<div class="row">
<button hx-disabled-elt="this" type="button" class="secondary small" hx-post="/settings/email/test" hx-target="#email-test" hx-indicator="#testing-email">Check the settings</button>
<form method="post" action="/settings/email/send-test" data-busy="Sending…"><button type="submit" class="secondary small">Send a test email to {{or $s.FromAddress "the From address"}}</button></form>
<span id="testing-email" class="htmx-indicator">Checking…</span>
</div>
<div id="email-test"></div>
</section>
{{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}}