email

package
v0.0.0-...-f7ed62b Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const FullValidConfigForTesting = `{
	"addresses": "test@grafana.com", 
	"subject": "test-subject", 
	"message": "test-message", 
	"singleEmail": true
}`

FullValidConfigForTesting is a string representation of a JSON object that contains all fields supported by the notifier Config. It can be used without secrets.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SingleEmail bool
	Addresses   []string
	Message     string
	Subject     string
}

func NewConfig

func NewConfig(jsonData json.RawMessage) (Config, error)

type Notifier

type Notifier struct {
	*receivers.Base
	// contains filtered or unexported fields
}

Notifier is responsible for sending alert notifications over email.

func New

func New(cfg Config, meta receivers.Metadata, template *templates.Template, sender receivers.EmailSender, images images.Provider, logger logging.Logger) *Notifier

func (*Notifier) Notify

func (en *Notifier) Notify(ctx context.Context, alerts ...*types.Alert) (bool, error)

Notify sends the alert notification.

func (*Notifier) SendResolved

func (en *Notifier) SendResolved() bool

Jump to

Keyboard shortcuts

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