Documentation
¶
Overview ¶
Package mail sends email: an SMTP driver, a log driver for development, MIME building and the localized templates. Sending normally happens in a background job (internal/jobs); the account service enqueues the rendered Message.
Index ¶
Constants ¶
View Source
const ( DriverNone = "none" DriverSMTP = "smtp" DriverLog = "log" // prints mail to the server log instead of sending (development) )
Drivers.
View Source
const ( KindVerifyEmail = "verify_email" KindResetPassword = "reset_password" KindEmailChanged = "email_changed" KindTest = "test" )
Kinds of mail SkinLoom sends.
Variables ¶
View Source
var ErrDisabled = errors.New("mail is not configured")
ErrDisabled means no mail driver is configured.
Functions ¶
func HasTemplate ¶ added in v1.1.0
HasTemplate reports whether kind names a built-in email template.
Types ¶
type Config ¶
type Config struct {
Driver string
From string // "Name <address>" or a bare address
Host string
Port int
Username string
Password string
Encryption string // tls (implicit, usually port 465) | starttls (usually 587) | none
}
Config is the active mail setup (from settings).
func ConfigFrom ¶
ConfigFrom reads the mail setup from a settings snapshot.
type Data ¶
type Data struct {
Site string // localized site name
Nickname string
Link string
NewEmail string // email_changed
}
Data fills a template.
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
Mailer sends messages with the configured driver.
Click to show internal directories.
Click to hide internal directories.