email

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRateLimitExceeded = errors.New("rate limit exceeded")

Functions

This section is empty.

Types

type EmailParams

type EmailParams struct {
	SMTPHost           string
	Port               int
	Username           string
	Password           string
	Sender             string
	LimitEveryDuration time.Duration
	Burst              int
}

type Emailer

type Emailer struct {
	Params  EmailParams
	Dialer  *gomail.Dialer
	Limiter *rate.Limiter
}

func NewEmailer

func NewEmailer(e EmailParams) *Emailer

func (*Emailer) SendEmail

func (e *Emailer) SendEmail(receivers []string, subject string, body string, attachmentFilePath []string) error

func (*Emailer) SendEmailWithLimit added in v0.63.0

func (e *Emailer) SendEmailWithLimit(receivers []string, subject string, body string, attachmentFilePath []string) error

Jump to

Keyboard shortcuts

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