Documentation
¶
Overview ¶
Package publicurl builds the absolute URLs that appear in emails and on public pages, so the code that writes them (sending, tracking, forms, reports) and the handlers that serve them agree on one layout:
/t/o/{token} open pixel (linktoken.Open)
/t/c/{token} click redirect (linktoken.Click)
/p/{workspace}/unsubscribe/{token} unsubscribe page; POST is RFC 8058 one-click
/p/{workspace}/preferences/{token} preference center
/p/{workspace}/confirm/{token} double opt-in confirmation
/p/{workspace}/view/{token} view an email in the browser
/p/{workspace}/subscribe[/{form}] hosted subscribe page
/p/{workspace}/archive[/{issue}] public newsletter archive
/p/{workspace}/archive.rss archive feed
/r/{token} read-only shared campaign report
{workspace} is the workspace slug. Handlers must still check that a token's workspace matches the slug in the path.
Index ¶
- Constants
- func Effective(saved, configured string) string
- type Builder
- func (b Builder) Archive(workspace string) string
- func (b Builder) ArchiveFeed(workspace string) string
- func (b Builder) ArchiveIssue(workspace, issue string) string
- func (b Builder) Base() string
- func (b Builder) Click(token string) string
- func (b Builder) Confirm(workspace, token string) string
- func (b Builder) Honeypot(token string) string
- func (b Builder) Open(token string) string
- func (b Builder) Preferences(workspace, token string) string
- func (b Builder) Report(token string) string
- func (b Builder) Subscribe(workspace, form string) string
- func (b Builder) Unsubscribe(workspace, token string) string
- func (b Builder) ViewOnline(workspace, token string) string
- type Source
Constants ¶
const ( TrackingPrefix = "/t" PagesPrefix = "/p" ReportPrefix = "/r" )
Path prefixes, for routers.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder joins paths onto the instance's public URL.
func (Builder) ArchiveFeed ¶
ArchiveFeed is the archive's RSS feed.
func (Builder) ArchiveIssue ¶
ArchiveIssue is one issue in the public archive.
func (Builder) Honeypot ¶
Honeypot is the hidden link of a tracked email: a person never sees it, so whatever follows it is a machine (review AN-2).
func (Builder) Preferences ¶
Preferences is the preference center.
func (Builder) Subscribe ¶
Subscribe is the hosted subscribe page; form is optional (the default form when empty).
func (Builder) Unsubscribe ¶
Unsubscribe is the unsubscribe page; mail clients POST to the same URL for one-click unsubscribe (List-Unsubscribe-Post: List-Unsubscribe=One-Click).
func (Builder) ViewOnline ¶
ViewOnline shows an email in the browser.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is the instance's public URL as it is now: the server's http.public_url until an instance admin saves another one. Every Builder made from a Source follows its changes.