Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailMessage ¶
type EmailMessage struct {
From string
To []string
Cc []string
Bcc []string
Subject string
Body string
IsHTML bool
}
EmailMessage represents a single email payload.
type EmailTarget ¶
type EmailTarget struct {
Host string
Port int
User string
Pass string
From string
To []string
StartTLS bool
SSL bool
InsecureSkipVerify bool
Template *templates.StringTemplate
TitleTmpl *templates.StringTemplate
Receiver string
Vars map[string]any
}
EmailTarget delivers notifications via SMTP.
func NewEmailTarget ¶
func NewEmailTarget(cfg EmailTarget) *EmailTarget
NewEmailTarget constructs an email target.
type WebhookTarget ¶
type WebhookTarget struct {
URL string
Headers map[string]string
Template *templates.Template
TitleTmpl *templates.StringTemplate
Client *http.Client
Logger *slog.Logger
Receiver string
Vars map[string]any
}
WebhookTarget delivers notifications to a webhook endpoint.
func NewWebhookTarget ¶
func NewWebhookTarget( receiver string, url string, headers map[string]string, tmpl *templates.Template, titleTmpl *templates.StringTemplate, vars map[string]any, logger *slog.Logger, ) *WebhookTarget
NewWebhookTarget constructs a webhook target.
func (*WebhookTarget) Send ¶
func (w *WebhookTarget) Send(n types.Payload) error
Send renders and posts a webhook notification.
func (*WebhookTarget) SendResult ¶
func (w *WebhookTarget) SendResult(n types.Payload) (types.DeliveryResult, error)
SendResult renders and posts a webhook notification and returns response details.
func (*WebhookTarget) Type ¶
func (w *WebhookTarget) Type() string
Type returns the target type name.
Click to show internal directories.
Click to hide internal directories.