email

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsSesClient

type AwsSesClient interface {
	// SendEmail API operation for Amazon Simple Email Service.
	SendEmail(input *ses.SendEmailInput) (*ses.SendEmailOutput, error)
}

type DataReader

type DataReader struct {
	// contains filtered or unexported fields
}

func NewDataReader

func NewDataReader(dir string, defaultFileName string, dataFileName string) (*DataReader, error)

func (*DataReader) Close

func (r *DataReader) Close() error

func (*DataReader) Read

func (r *DataReader) Read() (map[string]string, error)

type Message

type Message struct {
	Subject  string
	TextBody string
	HtmlBody string
}

type SendOptions added in v0.2.0

type SendOptions struct {
	From    string
	ReplyTo []string
	To      string
	Message *Message
}

type Service

type Service interface {
	Send(opts *SendOptions) error
	io.Closer
}

func ApplyOptions

func ApplyOptions(upstream Service, opts ...ServiceOption) Service

ApplyOptions wraps the given `upstream` service in the given service options (decorators).

func NewAwsSesService

func NewAwsSesService(cfg *config.AwsSesServiceConfig, opts ...ServiceOption) (Service, error)

func NewAwsSesServiceWithClient

func NewAwsSesServiceWithClient(client AwsSesClient, opts ...ServiceOption) Service

func NewPrintService

func NewPrintService(w io.Writer, opts ...ServiceOption) Service

func NewSmtpService added in v0.3.0

func NewSmtpService(cfg *config.SmtpServiceConfig, opts ...ServiceOption) (Service, error)

func NewSmtpServiceWithClient added in v0.3.0

func NewSmtpServiceWithClient(client SmtpClient, opts ...ServiceOption) Service

type ServiceOption

type ServiceOption func(upstream Service) Service

func WithRateLimit

func WithRateLimit(frequency int) ServiceOption

func WithRetries

func WithRetries(retryCount int) ServiceOption

type SmtpClient added in v0.3.0

type SmtpClient interface {
	SendEmail(email *mail.Email) error
	io.Closer
}

type Template

type Template struct {
	// contains filtered or unexported fields
}

func NewTemplate

func NewTemplate(dir string, minifyHtml bool) (*Template, error)

func (*Template) Render

func (t *Template) Render(data any) (*Message, error)

Jump to

Keyboard shortcuts

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