Documentation ¶
Index ¶
- func NewSESConfigSingletonInjector(cfg *SESConfig) injectz.Injector
- func NewSMTPConfigSingletonInjector(cfg *SMTPConfig) injectz.Injector
- func NewSingletonInjector(m Mail) injectz.Injector
- func SESInitializer(ctx context.Context) (injectz.Injector, injectz.Releaser)
- func SMTPInitializer(ctx context.Context) (injectz.Injector, injectz.Releaser)
- type ContextMail
- type Mail
- type Message
- type SESConfig
- type SESSender
- type SMTPConfig
- type SMTPSender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSESConfigSingletonInjector ¶
NewSESConfigSingletonInjector always inject the given SESConfig.
func NewSMTPConfigSingletonInjector ¶
func NewSMTPConfigSingletonInjector(cfg *SMTPConfig) injectz.Injector
NewSMTPConfigSingletonInjector always inject the given SMTPConfig.
func NewSingletonInjector ¶
NewSingletonInjector always injects the given Mail.
func SESInitializer ¶
SESInitializer is a Mail initializer which provides a default implementation using the AWS SESv2 API.
Types ¶
type ContextMail ¶
ContextMail describes a Mail with a cached context.
func Get ¶
func Get(ctx context.Context) ContextMail
Get extracts the Mail from context and wraps it as ContextMail, panics if not found.
type Message ¶
type Message struct { From string `json:"from"` ReplyTo string `json:"replyTo"` To []string `json:"to"` CC []string `json:"cc"` Subject string `json:"subject"` TextBody string `json:"textBody"` HTMLBody string `json:"htmlBody"` }
Message describes a message.
type SESSender ¶
type SESSender interface {
SendEmail(ctx context.Context, params *awssesv2.SendEmailInput, optFns ...func(*awssesv2.Options)) (*awssesv2.SendEmailOutput, error)
}
SESSender describes the ability to send mail over the AWS SESv2 API.
type SMTPConfig ¶
type SMTPConfig struct { URL string `json:"url" validate:"required,url"` ConnectTimeoutSeconds uint32 `json:"connectTimeoutSeconds" validate:"required"` }
SMTPConfig describes the configuration for the SMTP Mail implementation.
func (*SMTPConfig) Validate ¶ added in v1.1.0
func (c *SMTPConfig) Validate() error
Validate implements the vz.Validator interface.
type SMTPSender ¶
type SMTPSender interface {
DialAndSend(m ...*mail.Message) error
}
SMTPSender describes the ability to send mail over SMTP.