Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingSender = fmt.Errorf("sender address missing") ErrMissingRecipient = fmt.Errorf("recipient address missing") )
Functions ¶
Types ¶
type AmazonSESMailer ¶
type AmazonSESMailer struct { From string `mapstructure:"from"` To string `mapstructure:"to"` Region string `mapstructure:"region"` Session *sesv2.SESV2 Logger *log.Logger }
AmazonSESMailer represents a mail sender for Amazon SES.
func (AmazonSESMailer) Init ¶
func (s AmazonSESMailer) Init() error
Init implements the Mailer's Init interface.
func (AmazonSESMailer) Send ¶
func (s AmazonSESMailer) Send(subject, body string) error
Send implements the Mailer's Send interface.
type NoOpMailer ¶ added in v0.3.0
type NoOpMailer struct{}
NoOpMailer is a dummy mailer that doesn't send mail.
func (NoOpMailer) Init ¶ added in v0.3.0
func (m NoOpMailer) Init() error
Init implements the Mailer's Init interface.
func (NoOpMailer) Send ¶ added in v0.3.0
func (m NoOpMailer) Send(_, _ string) error
Send implements the Mailer's Send interface.
type SMTPMailer ¶
type SMTPMailer struct { From string `mapstructure:"from"` To string `mapstructure:"to"` Server string `mapstructure:"server"` Port int `mapstructure:"port"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` CaCert string `mapstructure:"ca_cert_file"` RequireEncryption bool `mapstructure:"require_encryption"` }
SMTPMailer represents a mail sender for plain SMTP.
func (SMTPMailer) Init ¶
func (s SMTPMailer) Init() error
Init implements the Mailer's Init interface.
func (SMTPMailer) Send ¶
func (s SMTPMailer) Send(subject, body string) error
Send implements the Mailer's Send interface.
type SendgridMailer ¶
type SendgridMailer struct { From string `mapstructure:"from"` To string `mapstructure:"to"` APIKey string `mapstructure:"token"` Client *sendgrid.Client Logger *log.Logger }
SendgridMailer represents a mail sender for sendgrid.
func (*SendgridMailer) Init ¶
func (s *SendgridMailer) Init(from, to string) error
Init implements the Mailer's Init interface.
func (SendgridMailer) Send ¶
func (s SendgridMailer) Send(subject, body string) error
Send implements the Mailer's Send interface.
Click to show internal directories.
Click to hide internal directories.