Documentation
¶
Overview ¶
Package mailtemplate substitutes [site:...]/[user:...] placeholders, and a module's own (TokenData.Extra), in email subject/body templates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReplacePlaceholders ¶
ReplacePlaceholders substitutes [token] placeholders in template text (plain).
Types ¶
type Mailer ¶
Mailer sends one of the site's emails by its key: the site keeps its template and whether it is sent; data fills in the placeholders.
type TokenData ¶
type TokenData struct {
SiteName string
SiteSlogan string
SiteLoginURL string
SiteURLBrief string // scheme + host, no path
SitePeoplePendingURL string
UserName string
UserEmail string
ConfirmEmailURL string // /user/confirm-email?token=
OneTimeLoginURL string
ResetPasswordURL string // /user/reset-password?token=
UserEditURL string
// Extra - a module's own placeholders and their values
// ("[pm:sender]" → a name), substituted after the ones above.
Extra map[string]string
}
TokenData holds values for [site:...] and [user:...] placeholders in email bodies/subjects, and a module's own in Extra.
Click to show internal directories.
Click to hide internal directories.