ses

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNilConfig indicates a nil config was provided.
	ErrNilConfig = platformerrors.New("ses config is nil")
	// ErrEmptyRegion indicates an empty AWS region was provided.
	ErrEmptyRegion = platformerrors.New("empty AWS region")
	// ErrNilHTTPClient indicates a nil HTTP client was provided.
	ErrNilHTTPClient = platformerrors.New("nil HTTP client")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Region string `env:"REGION" json:"region"`
}

Config configures AWS SES to send email.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates a Config struct.

type Emailer

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

Emailer uses AWS SES v2 to send email.

func NewSESEmailer

func NewSESEmailer(ctx context.Context, cfg *Config, logger logging.Logger, tracerProvider tracing.TracerProvider, httpClient *http.Client, circuitBreaker circuitbreaking.CircuitBreaker, metricsProvider metrics.Provider, sesClient SendEmailAPI) (*Emailer, error)

NewSESEmailer returns a new AWS SES-backed Emailer. If sesClient is non-nil it is used directly; otherwise a new SES v2 client is created from the default AWS credential chain using the provided HTTP client.

func (*Emailer) SendEmail

func (e *Emailer) SendEmail(ctx context.Context, details *email.OutboundEmailMessage) error

SendEmail sends an email via AWS SES v2.

type SendEmailAPI

type SendEmailAPI interface {
	SendEmail(ctx context.Context, params *sesv2.SendEmailInput, optFns ...func(*sesv2.Options)) (*sesv2.SendEmailOutput, error)
}

SendEmailAPI abstracts the SES v2 SendEmail call for testability.

Jump to

Keyboard shortcuts

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