Versions in this module Expand all Collapse all v0 v0.4.0 Sep 6, 2026 v0.3.0 Aug 18, 2026 v0.2.0 Aug 6, 2026 Changes in this version + const BackoffBase + const BackoffMax + const DrainBatch + const FinishedRetentionDays + const MaxAttempts + const SendConcurrency + const TLSImplicit + const TLSNone + const TLSStartTLS + var ErrHeaderInjection = errors.New("mail: header value contains a line break") + func Backoff(attempts int) time.Duration + func BuildMessage(from *mail.Address, to, subject, body string, now time.Time) ([]byte, error) + type Config struct + Logger *slog.Logger + Renderer Renderer + Sender Sender + type Enqueuer interface + Enqueue func(ctx context.Context, to, kind string, data map[string]string) error + type Renderer interface + RenderMail func(name string, data map[string]string) (subject, body string, err error) + type SMTPOptions struct + From string + Host string + Password string + Port int + TLS string + Timeout time.Duration + Username string + type SMTPSender struct + func NewSMTPSender(opts SMTPOptions) (*SMTPSender, error) + func (s *SMTPSender) Addr() string + func (s *SMTPSender) Send(ctx context.Context, to, subject, body string) error + func (s *SMTPSender) Verify(ctx context.Context) error + type Sender interface + Send func(ctx context.Context, to, subject, body string) error + type Service struct + func NewService(pool *pgxpool.Pool, cfg Config) (*Service, error) + func (s *Service) Drain(ctx context.Context) error + func (s *Service) Enqueue(ctx context.Context, to, kind string, data map[string]string) error + func (s *Service) Pending(ctx context.Context) (int64, error) + func (s *Service) PurgeFinished(ctx context.Context) (int64, error)