mailer

package
v0.0.0-...-bcfd2cf Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Client SGClient
	Email  string
}

Client instance wrapper

func NewClient

func NewClient(conf *Config) (*Client, error)

NewClient returns a new instance of sendgrid client

type Config

type Config struct {
	Key   string
	Email string
}

Config sendgrid configuration options

func Conf

func Conf() *Config

Conf default sendgrid configuration options

type MockClient

type MockClient struct {
	sendgrid.Client
}

MockClient mocks sendgrid client

func NewMockClient

func NewMockClient(key string) *MockClient

NewMockClient returns a mock instance of sendgrid client

func (*MockClient) Send

func (sg *MockClient) Send(email *mail.SGMailV3) (resp *rest.Response, err error)

Send mock function that always return positive reponse for send action

type SGClient

type SGClient interface {
	Send(*mail.SGMailV3) (*rest.Response, error)
}

SGClient interface to define mailer client

Jump to

Keyboard shortcuts

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