emails

package
v0.0.0-...-88f351d Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: MIT, CC-BY-4.0, MIT, + 1 more Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonData

type CommonData struct {
	templates.StaticFiles
	AccountEmailAddress string
	LocalDomain         string
}

type Deliverer

type Deliverer interface {
	Deliver(ctx scope.Context, ref *EmailRef) error
	LocalName() string
}

type EmailRef

type EmailRef struct {
	ID        string
	AccountID snowflake.Snowflake
	JobID     snowflake.Snowflake
	EmailType string
	SendTo    string
	SendFrom  string
	Message   []byte
	Created   time.Time
	Delivered time.Time
	Failed    time.Time
	// contains filtered or unexported fields
}

func NewEmail

func NewEmail(templater *templates.Templater, msgID, to, templateName string, data interface{}) (*EmailRef, error)

type Emailer

type Emailer interface {
	Send(ctx scope.Context, to, templateName string, data interface{}) (*EmailRef, error)
}

type MockDeliverer

type MockDeliverer interface {
	Deliverer

	Inbox(addr string) <-chan *TestMessage
}

type SMTPDeliverer

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

func NewSMTPDeliverer

func NewSMTPDeliverer(localAddr, serverAddr, sslHost string, auth smtp.Auth) *SMTPDeliverer

func (*SMTPDeliverer) Deliver

func (s *SMTPDeliverer) Deliver(ctx scope.Context, ref *EmailRef) error

func (*SMTPDeliverer) LocalName

func (s *SMTPDeliverer) LocalName() string

func (*SMTPDeliverer) String

func (s *SMTPDeliverer) String() string

type TestDeliverer

type TestDeliverer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*TestDeliverer) Deliver

func (td *TestDeliverer) Deliver(ctx scope.Context, ref *EmailRef) error

func (*TestDeliverer) Inbox

func (td *TestDeliverer) Inbox(addr string) <-chan *TestMessage

func (*TestDeliverer) LocalName

func (td *TestDeliverer) LocalName() string

type TestMessage

type TestMessage struct {
	EmailRef
	Data interface{}
}

Jump to

Keyboard shortcuts

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