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.
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.
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.
Click to show internal directories.
Click to hide internal directories.