email

package
v0.0.0-...-3dc0db1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseTmpl string

BaseTmpl represents the base template used by emails.

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

ErrFakeSenderFailure represents a fake sender failure.

View Source
var ErrSenderNotAvailable = errors.New("email sender not available")

ErrSenderNotAvailable error indicates that there is not a mail sender available. This usually happens when the email configuration hasn't been set up.

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