email

package
v0.97.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRateLimitExceeded     = errors.New("rate limit exceeded")
	ErrNoSMTPHostConfigured  = errors.New("no smtp host configured")
	ErrNoSenderConfigured    = errors.New("no sender configured")
	ErrNoRecipientConfigured = errors.New("no recipient configured")
	ErrSenderMisconfigured   = errors.New("sender misconfigured")
)

Functions

This section is empty.

Types

type DialAndSender

type DialAndSender interface {
	DialAndSend(m ...*gomail.Message) error
}

type Emailer

type Emailer struct {
	Params  Params
	Dialer  DialAndSender
	Limiter *rate.Limiter
}

func NewEmailer

func NewEmailer(p Params) (*Emailer, error)

func (*Emailer) SendEmail

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

func (*Emailer) SendEmailWithLimit

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

func (*Emailer) SendInviteUserEmail

func (e *Emailer) SendInviteUserEmail(receivers []string, params map[string]string) error

func (*Emailer) SendResetPasswordEmail

func (e *Emailer) SendResetPasswordEmail(receivers []string, params map[string]string) error

type Params

type Params struct {
	SMTPHost           string
	SMTPPort           int
	UseSSL             bool
	Username           string
	Password           string
	LocalName          string
	Sender             string
	LimitEveryDuration time.Duration
	Burst              int
	LakefsBaseURL      string
}

type TemplateParams

type TemplateParams struct {
	URL string
}

Jump to

Keyboard shortcuts

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