Documentation
¶
Overview ¶
Package mailer sends transactional email through a pluggable Sender.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogSender ¶
type LogSender struct {
// contains filtered or unexported fields
}
LogSender logs the recipient and subject instead of sending. Dev fallback.
func NewLogSender ¶
func NewLogSender() *LogSender
NewLogSender returns a LogSender backed by the default logger.
type MemorySender ¶
type MemorySender struct {
// contains filtered or unexported fields
}
MemorySender captures sent messages for tests.
func (*MemorySender) Messages ¶
func (s *MemorySender) Messages() []Message
Messages returns a copy of the captured messages.
type Message ¶
type Message struct {
To []string `json:"to"`
Subject string `json:"subject"`
HTML string `json:"html,omitempty"`
Text string `json:"text,omitempty"`
}
Message is a single email. It is JSON-serializable so it can double as a job payload.
type SMTPConfig ¶
SMTPConfig configures the SMTP sender.
type SMTPSender ¶
type SMTPSender struct {
// contains filtered or unexported fields
}
SMTPSender sends via go-mail over SMTP.
func NewSMTP ¶
func NewSMTP(cfg SMTPConfig) (*SMTPSender, error)
NewSMTP builds an SMTP sender. SMTP auth is used only when Username is set; TLS is opportunistic (works against a local mailhog as well as real servers).
Click to show internal directories.
Click to hide internal directories.