Documentation
¶
Overview ¶
Package mail sends transactional email over SMTP (STARTTLS, implicit TLS or plain) with the standard library, and renders the panel's email templates in English and Indonesian.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SMTP ¶
type SMTP struct {
// Dial overrides the TCP dial (tests).
Dial func(ctx context.Context, addr string) (net.Conn, error)
}
SMTP sends through the configured server.
type Settings ¶
type Settings struct {
Host string `json:"host"`
Port int `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
// Security: "starttls" (port 587), "tls" (implicit TLS, port 465) or "none" (local relay only).
Security string `json:"security"`
From string `json:"from"`
FromName string `json:"from_name"`
// RequireVerification makes customers confirm their email before ordering.
RequireVerification bool `json:"require_verification"`
}
Settings is the SMTP configuration (stored in the settings table under "mail").
func DefaultSettings ¶
func DefaultSettings() Settings
DefaultSettings: not configured, verification required once it is.
func (Settings) Configured ¶
Configured reports whether email can be sent.
Click to show internal directories.
Click to hide internal directories.