email

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFakeSenderFailure = errors.New("fake sender failure")

ErrFakeSenderFailure represents a fake sender failure.

Functions

This section is empty.

Types

type Data

type Data struct {
	To      string
	Subject string
	Body    []byte
}

Data describes the different pieces of data used to compose an email.

type Sender

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

Sender is in charge of sending emails.

func NewSender

func NewSender(cfg *viper.Viper) *Sender

NewSender creates a new Sender instance and returns it.

func (*Sender) SendEmail

func (s *Sender) SendEmail(d *Data) error

SendEmail creates an email using the data provided and sends it.

type SenderMock

type SenderMock struct {
	mock.Mock
}

SenderMock is a mock implementation of the hub EmailSender interface.

func (*SenderMock) SendEmail

func (m *SenderMock) SendEmail(data *Data) error

SendEmail implements the EmailSender interface.

Jump to

Keyboard shortcuts

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