mailservice

package
v0.0.0-...-0973f41 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DownstreamError = errors.New("downstream unavailable - see log for details")
)

Functions

This section is empty.

Types

type Impl

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

func (Impl) SendEmail

func (i Impl) SendEmail(ctx context.Context, request MailSendDto) error

type MailSendDto

type MailSendDto struct {
	CommonID  string            `json:"cid"`
	Lang      string            `json:"lang"`
	To        []string          `json:"to"`
	Cc        []string          `json:"cc"`
	Bcc       []string          `json:"bcc"`
	Variables map[string]string `json:"variables"`
}

type MailService

type MailService interface {
	SendEmail(ctx context.Context, request MailSendDto) error
}

func New

func New(mailServiceBaseUrl string, apiToken string) (MailService, error)

type Mock

type Mock interface {
	MailService

	Reset()
	Recording() []MailSendDto
	SimulateError(err error)
}

func NewMock

func NewMock() Mock

type MockImpl

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

func (*MockImpl) Recording

func (m *MockImpl) Recording() []MailSendDto

func (*MockImpl) Reset

func (m *MockImpl) Reset()

func (*MockImpl) SendEmail

func (m *MockImpl) SendEmail(ctx context.Context, request MailSendDto) error

func (*MockImpl) SimulateError

func (m *MockImpl) SimulateError(err error)

Jump to

Keyboard shortcuts

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