Documentation
¶
Overview ¶
Package mail is togo's email subsystem: a Mailer contract with an SMTP driver (default) and a dev "log" driver. Additional providers (AWS SES, Resend, …) ship as driver plugins that call mail.RegisterDriver and depend on this package. Used by auth for OTP/verification/reset flows.
Install: `togo install togo-framework/mail` (blank-import registers it).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDriver ¶
func RegisterDriver(name string, f DriverFactory)
RegisterDriver registers a mail driver by name (call from a plugin's init()).
Types ¶
type DriverFactory ¶
DriverFactory builds a Mailer from the kernel (env-configured).
type Message ¶
type Message struct {
From string
To []string
Cc []string
Bcc []string
Subject string
Text string // plain-text body
HTML string // optional HTML body
}
Message is an email to send.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the mail runtime stored on the kernel (k.Get("mail")).
func FromKernel ¶
FromKernel fetches the mail service from the kernel container.