email

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package email delivers Console events as plain-text email over SMTP. It uses only net/smtp from the standard library: PLAIN auth is used when a username is configured (so it should be paired with a TLS-capable submission port such as 587), and an unauthenticated send is attempted otherwise.

The actual transmission is held behind an unexported send func field that defaults to smtp.SendMail. Tests substitute it to assert the recipients, sender, and message bytes without standing up a real SMTP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Host is the SMTP server hostname.
	Host string
	// Port is the SMTP server port (e.g. "587").
	Port string
	// Username and Password enable PLAIN auth when Username is non-empty.
	Username string
	Password string
	// From is the envelope and header sender address.
	From string
	// To is the list of recipient addresses.
	To []string
}

Config carries the SMTP settings for a Notifier.

type Notifier

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

Notifier sends events as email over SMTP.

func New

func New(cfg Config) *Notifier

New builds an email notifier from cfg.

func (*Notifier) Name

func (n *Notifier) Name() string

Name identifies the sink.

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, ev core.Event) error

Notify builds an RFC 5322 message for ev and sends it via SMTP. The context is honored by returning early if it is already done before the send.

Jump to

Keyboard shortcuts

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