providers

package
v0.0.0-...-8922687 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchedProvider

type BatchedProvider interface {
	// SendBatch dispatches an email message to the provider for sending to many recipients
	SendBatch(ctx context.Context, l *zap.Logger, to []string, from string, subject string, body string, htmlBody, replyTo *string) error
}

BatchedProvider is an extension to the Provider stating that the provider natively supports batching

type Debug

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

func (*Debug) Name

func (d *Debug) Name() string

func (*Debug) Send

func (d *Debug) Send(ctx context.Context, l *zap.Logger, to, from, subject, body string, htmlBody, replyTo *string) error

func (*Debug) SendBatch

func (d *Debug) SendBatch(ctx context.Context, l *zap.Logger, to []string, from, subject, body string, htmlBody, replyTo *string) error

type MailGun

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

func (*MailGun) Name

func (m *MailGun) Name() string

func (*MailGun) Send

func (m *MailGun) Send(ctx context.Context, l *zap.Logger, to, from, subject, body string, htmlBody, replyTo *string) error

func (*MailGun) SendBatch

func (m *MailGun) SendBatch(ctx context.Context, l *zap.Logger, to []string, from, subject, body string, htmlBody, replyTo *string) error

type Provider

type Provider interface {
	// Send dispatches an email message to the provider for sending to one recipient
	Send(ctx context.Context, l *zap.Logger, to string, from string, subject string, body string, htmlBody, replyTo *string) error
	// Name retrieves the name of the provider
	Name() string
}

Provider is an interface to an email provider

func Get

func Get(id, typeName string) (Provider, error)

Get retrieves and creates the provider

func NewDebug

func NewDebug(id string) (Provider, error)

NewDebug creates a new Debug email provider

func NewMailgun

func NewMailgun(id string) (Provider, error)

NewMailgun creates a new MailGun email provider

func NewSES

func NewSES(id string) (Provider, error)

func NewSMTP

func NewSMTP(id string) (Provider, error)

type SES

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

func (*SES) Name

func (s *SES) Name() string

func (*SES) Send

func (s *SES) Send(ctx context.Context, _ *zap.Logger, to, from, subject, body string, htmlBody, replyTo *string) error

type SMTP

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

func (*SMTP) Name

func (s *SMTP) Name() string

func (*SMTP) Send

func (s *SMTP) Send(ctx context.Context, l *zap.Logger, to, from, subject, body string, htmlBody, replyTo *string) error

Jump to

Keyboard shortcuts

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