Documentation
¶
Overview ¶
Package mailgroups defines email audiences: saved rules over platform users plus manual addresses, with a suppression list and signed one-click unsubscribe tokens.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Roles = []string{"owner", "admin", "operator", "viewer"}
Roles a rule can select.
Functions ¶
func SignUnsubscribe ¶
SignUnsubscribe returns a token naming email that only this instance can have produced. It never expires: an unsubscribe link must keep working.
func ValidAddress ¶
ValidAddress reports an error unless a is one bare email address.
Types ¶
type Directory ¶
type Directory struct {
Users []User
// ProjectTeams maps a project id onto the team that owns it.
ProjectTeams map[string]string
}
Directory is everything Resolve needs to know about the instance.
type Recipient ¶
type Recipient struct {
Email string `json:"email"`
UserID string `json:"user_id"`
DisplayName string `json:"display_name"`
Role string `json:"role"`
}
Recipient is one resolved address.
type Rules ¶
type Rules struct {
AllUsers bool `json:"all_users"`
Roles []string `json:"roles"`
Teams []string `json:"teams"`
Projects []string `json:"projects"`
EmailDomains []string `json:"email_domains"`
InactiveDays int `json:"inactive_days"`
ExtraAddresses []string `json:"extra_addresses"`
ExcludeAddresses []string `json:"exclude_addresses"`
}
Rules selects recipients. A user is included when any selector matches (AllUsers, Roles, Teams, Projects, EmailDomains); InactiveDays then narrows the result, and alone selects every user inactive that long. ExtraAddresses are added as-is; ExcludeAddresses are always removed.