Tasks completed: 3/3 - Render and send one registered template through memory - Register plugin layouts and publish the mailer at Boot - Add config-selected log and SMTP delivery SUMMARY: .planning/phases/04-cli-scaffolding-i18n-and-mail/04-03-SUMMARY.md Co-authored-by: Cursor <cursoragent@cursor.com>
6.6 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, requirements-completed, duration, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | requirements-completed | duration | completed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 04-cli-scaffolding-i18n-and-mail | 03 |
|
|
|
|
|
|
|
|
|
6min | 2026-09-18 |
Phase 4 Plan 03: postcard mail Summary
Winter-shaped mail templates and layouts render safe Markdown/HTML and send through memory, log, or go-mail SMTP selected by mail.*
Performance
- Duration: 6 min
- Started: 2026-09-18T11:56:07Z
- Completed: 2026-09-18T12:02:31Z
- Tasks: 3
- Files modified: 15
Accomplishments
postcardparses INI headers,==separators, and Markdown bodies;html/templatesubstitutes vars, Goldmark renders HTML, and the substituted Markdown is the text part- Plugins register dotted template names and short layout aliases; missing files and unknown layouts fail
party: boot <plugin ID>with the full name postcard.Maileris app-scoped; hello sendsgolem15.hello::mail.helloandhello-enthrough backpack, using the pluginhellolayoutmail.driverselects memory, log, or smtp (SUMMER_MAIL__overrides); SMTP uses explicit TLS, address/CRLF checks, and context-aware go-mail send without retries
Task Commits
Each task was committed atomically:
- Task 1: Render and send one registered template through memory -
b4fd833(feat) - Task 2: Register plugin layouts and publish the mailer at Boot -
1e51597(feat) - Task 3: Add config-selected log and SMTP delivery -
1b72456(feat)
Plan metadata: (this commit)
Files Created/Modified
postcard/templates.go- Winter parser, catalog registration, Goldmark render, HTML safetypostcard/mailer.go- Message/Mailer, Activate, BootPlugin, config-selected driverpostcard/drivers.go- Driver interface plus memory, log, SMTP, and FailDriverpostcard/assets/default.htm- Neutral framework layoutpostcard/mailer_test.go- render, layout, and driver smokesparty/registry.go- Publish mailer before Boot; validate catalogs at Bootexamples/hello/plugins/base/plugin.go- HasMailTemplates with hello and hello-enexamples/hello/plugins/base/views/mail/- Distinct default-locale and -en templates plus hello layoutexamples/hello/config/mail.yaml- memory driver and documented smtp/NoTLS shapego.mod/go.sum- goldmark v1.8.6 and go-mail v0.8.1
Decisions Made
- Goldmark stays on v1 (v2 is still a new line); unsafe HTML stays disabled and final HTML is re-checked
- Default layout is internal (
layout = defaultor omitted); plugins cannot aliasdefault - TLS empty/mandatory maps to go-mail
TLSMandatory;none/notlsis explicit Mailpit opt-in;starttlsis opportunistic only when named - Mailpit real SMTP receipt stays Plan 04 (D-19); this plan uses an in-process FailDriver and a closed-port SMTP error
Deviations from Plan
Auto-fixed Issues
1. [Rule 2 - Missing Critical] Three-section layout parser shipped with Task 1
- Found during: Task 1 (embedded default layout)
- Issue: The neutral default layout is header + text wrapper + HTML wrapper, so memory-driver HTML/text wrapping could not wait for Task 2
- Fix: Parse two-
==layouts intemplates.goin Task 1; Task 2 still added plugin aliases, party Boot validation, and the hello layout - Files modified:
postcard/templates.go,postcard/assets/default.htm - Verification:
TestMailRenderSmokeassertscontent-bodyfrom the default layout - Committed in:
b4fd833(Task 1 commit)
Total deviations: 1 auto-fixed (1 missing critical) Impact on plan: No behavior divergence from D-06–D-09 or D-18–D-21. Layout parsing was required to honor the Task 1 default-layout artifact.
Issues Encountered
None
User Setup Required
None - no external service configuration required. Production SMTP credentials stay in mail.* / SUMMER_MAIL__; Mailpit is Plan 04.
Next Phase Readiness
Ready for 04-04 (unit tests and Mailpit). Memory render, layout wrappers, named boot errors, log/SMTP driver contracts, and a failing-driver seam are in place. Do not treat -short as SMTP receipt.
Verification
go test ./postcard -run 'TestMailRenderSmoke|TestMailLayoutSmoke|TestMailDriverSmoke' -short -count=1— PASSgo -C examples/hello test ./...— PASSgo vet ./... && go test ./...— PASS
Self-Check: PASSED
Phase: 04-cli-scaffolding-i18n-and-mail Completed: 2026-09-18