Documentation
¶
Overview ¶
Package mailer renders templates and sends transactional email over SMTP.
Index ¶
Constants ¶
View Source
const DefaultSendTimeout = 15 * time.Second
DefaultSendTimeout bounds one SMTP transaction.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
// To is the recipient address.
To string
// Subject is the message subject.
Subject string
// Template names resolve to matching HTML and text templates.
Template string
// Data feeds the template's .Data tree.
Data map[string]any
}
Message is a message to render and send.
type Options ¶
type Options struct {
// Templates is the source of template files.
Templates fs.FS
// LogoURL is available to templates.
LogoURL string
// Logger receives send attempts and failures. Nil disables logging.
Logger logger.Logger
// SendTimeout bounds one SMTP transaction when ctx has no
// deadline. Zero uses DefaultSendTimeout.
SendTimeout time.Duration
}
Options configures New.
Click to show internal directories.
Click to hide internal directories.