email

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package email sends transactional mail (account invitations) over SMTP, using configuration loaded at startup. When disabled, callers fall back to sharing an invite's link directly.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConfigured = errors.New("email: SMTP not configured")

ErrNotConfigured is returned by Send when SMTP is disabled or incomplete.

Functions

This section is empty.

Types

type Mailer

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

Mailer sends mail through a configured SMTP server.

func New

func New(cfg SMTP) *Mailer

func (*Mailer) Enabled

func (m *Mailer) Enabled() bool

Enabled reports whether a usable SMTP configuration is present.

func (*Mailer) Send

func (m *Mailer) Send(to, subject, body string) error

Send delivers a plain-text message to a single recipient.

type SMTP

type SMTP struct {
	Enabled  bool
	Host     string
	Port     int
	From     string
	Username string
	Password string
	UseTLS   bool
}

SMTP is the outbound mail configuration.

Jump to

Keyboard shortcuts

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