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 ¶
*
- 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) Send ¶
*
- 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"`
}
Click to show internal directories.
Click to hide internal directories.