package mail import ( "bytes" "fmt" htmltmpl "html/template" "strings" "github.com/yuin/goldmark" ) // Announcement is one product email to one person: a feature launch, a guide, // an offer. vantage-admin's announce package builds it per recipient, because // the unsubscribe links carry that person's token. type Announcement struct { CategoryLabel string // "New features" Subject string BodyMarkdown string UnsubscribeURL string // RFC 8058 one-click target for this category PreferencesURL string // the no-login preferences page PostalAddress string // optional footer line } type announcementData struct { Announcement BodyHTML htmltmpl.HTML } // md renders with goldmark's defaults, which omit raw HTML: a pasted