usermail

package
v1.0.63 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enabled

func Enabled(cfg *appconfig.Config) bool

Enabled reports whether all required mail settings are currently usable.

Types

type Message

type Message struct {
	To      string
	Subject string
	Text    string
}

type ResolvedConfig

type ResolvedConfig struct {
	PublicUserURL   *url.URL
	FromAddress     string
	FromName        string
	SMTP            SMTPConfig
	VerificationTTL time.Duration
	ResetTTL        time.Duration
}

func ResolveConfig

func ResolveConfig(cfg *appconfig.Config) (ResolvedConfig, error)

ResolveConfig validates the current runtime mail configuration.

type SMTPConfig

type SMTPConfig struct {
	Host     string
	Port     int
	Username string
	Password string
	StartTLS bool
	Timeout  time.Duration
}

type SMTPSender

type SMTPSender struct {
	// contains filtered or unexported fields
}

func NewSMTPSender

func NewSMTPSender(cfg ResolvedConfig) *SMTPSender

func (*SMTPSender) Send

func (s *SMTPSender) Send(ctx context.Context, message Message) error

type Sender

type Sender interface {
	Send(context.Context, Message) error
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(repo *cluster.Repository, configProvider func() *appconfig.Config) *Service

func (*Service) ProcessOne

func (s *Service) ProcessOne(ctx context.Context) (bool, error)

ProcessOne processes at most one queued message and is exported for focused tests.

func (*Service) Start

func (s *Service) Start(ctx context.Context)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL