email

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DestTypeEmail     = "builtin-smtp-email"
	FieldEmailAddress = "email_address"
	FallbackIconURL   = "builtin://email"
)

Variables

This section is empty.

Functions

func LoginAuth

func LoginAuth(user, pass, host string) smtp.Auth

LoginAuth implements the LOGIN authentication mechanism.

Adapted from smtp.PlainAuth in the standard library.

func NewEmailDest added in v0.33.0

func NewEmailDest(address string) gadb.DestV1

func SendMail

func SendMail(ctx context.Context, addr string, a NegotiateAuth, from string, to []string, msg []byte, cfg *tls.Config) error

SendMail will send a message using the provided server and optional auth. It will attempt to use STARTTLS if available from the server.

func SendMailTLS

func SendMailTLS(ctx context.Context, addr string, a NegotiateAuth, from string, to []string, msg []byte, cfg *tls.Config) error

SendMailTLS will send a message using the provided server over a TLS connection and optional auth.

Types

type NegotiateAuth

type NegotiateAuth func(auths string) smtp.Auth

NegotiateAuth should return the appropriate smtp.Auth for the given server auth string.

type Sender

type Sender struct{}

func NewSender

func NewSender(ctx context.Context) *Sender

func (*Sender) DisplayInfo added in v0.33.0

func (s *Sender) DisplayInfo(ctx context.Context, args map[string]string) (*nfydest.DisplayInfo, error)

func (*Sender) ID added in v0.33.0

func (s *Sender) ID() string

func (*Sender) SendMessage added in v0.33.0

func (s *Sender) SendMessage(ctx context.Context, msg notification.Message) (*notification.SentMessage, error)

Send will send an for the provided message type.

func (*Sender) TypeInfo added in v0.33.0

func (s *Sender) TypeInfo(ctx context.Context) (*nfydest.TypeInfo, error)

func (*Sender) ValidateField added in v0.33.0

func (s *Sender) ValidateField(ctx context.Context, fieldID, value string) error

Jump to

Keyboard shortcuts

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