Documentation
¶
Overview ¶
Package email sends notification batches over implicit-TLS SMTP.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidConfig indicates invalid transport or destination settings. ErrInvalidConfig = errors.New("invalid email configuration") // ErrInvalidAddress indicates an invalid envelope address. ErrInvalidAddress = errors.New("invalid email address") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string
Port string
Username string
Password string
From string
TLSServerName string
// TLSConfig overrides the default TLS configuration (TLS 1.2 minimum). NewTransport clones it.
TLSConfig *tls.Config
}
Config defines SMTP settings. All fields except TLSServerName and TLSConfig are required; From does not default to Username.
type Transport ¶
type Transport[T any] struct { // contains filtered or unexported fields }
Transport is an immutable SMTP client shared safely by concurrent destinations.
func NewTransport ¶
NewTransport validates cfg and creates a Transport without network I/O.
func (*Transport[T]) Recipient ¶
func (transport *Transport[T]) Recipient( id string, address string, renderer Renderer[T], ) (notifier.Destination[T], error)
Recipient creates a destination for one SMTP recipient.
func (*Transport[T]) RecipientGroup ¶
func (transport *Transport[T]) RecipientGroup( id string, addresses []string, renderer Renderer[T], ) (notifier.Destination[T], error)
RecipientGroup creates a destination that sends to all addresses in one SMTP transaction.
Click to show internal directories.
Click to hide internal directories.