email

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alerter

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

func New

func New(config *Config) *Alerter

*

  • New creates a new Email alerter instance.
  • Uses SMTP to send HTML-formatted emails with professional template.
  • Supports both plain SMTP and TLS connections. *
  • @param config SMTP configuration including host, credentials, and recipients
  • @return *Alerter Ready-to-use Email alerter

func (*Alerter) Name

func (a *Alerter) Name() string

func (*Alerter) Send

func (a *Alerter) Send(payload alerts.Payload) error

*

  • Send dispatches an alert via SMTP email.
  • Renders HTML template with error details and sends to all configured recipients.
  • Automatically handles TLS if configured. *
  • @param payload Alert data containing error details and request metadata
  • @return error Returns nil on success, or error if SMTP fails

type Config

type Config struct {
	Enabled    bool     `yaml:"enabled"`
	SMTPHost   string   `yaml:"smtp_host"`
	SMTPPort   int      `yaml:"smtp_port"`
	Username   string   `yaml:"username"`
	Password   string   `yaml:"password"`
	From       string   `yaml:"from"`
	To         []string `yaml:"to"`
	UseTLS     bool     `yaml:"use_tls"`
	SkipVerify bool     `yaml:"skip_verify"`
}

Jump to

Keyboard shortcuts

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