mailgun

package
v1.76.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package mailgun wraps the official client to provide unit test utilities and simplify the usage.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeout        = errors.New("timeout")
	ErrInvalidAddress = errors.New("invalid address")
)

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Filename string
	Content  []byte
}

type Client

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

func NewClient

func NewClient(apiKey string) *Client

func (*Client) Send

func (client *Client) Send(ctx context.Context, domain string, email *Email) error

func (*Client) SendReturnID added in v1.18.0

func (client *Client) SendReturnID(ctx context.Context, domain string, email *Email) (string, error)

func (*Client) ValidateEmail

func (client *Client) ValidateEmail(ctx context.Context, email string) (bool, error)

type Email

type Email struct {
	From          mail.Address
	To            mail.Address
	Subject       string
	HTML          string
	Tags          []string
	ReplyTo       string
	Attachments   []*Attachment
	UserVariables map[string]string
}

type Sender

type Sender interface {
	Send(ctx context.Context, domain string, email *Email) error
}

type SenderReturnID added in v1.20.0

type SenderReturnID interface {
	SendReturnID(ctx context.Context, domain string, email *Email) (string, error)
}

type Validator

type Validator interface {
	ValidateEmail(ctx context.Context, email string) (bool, error)
}

Jump to

Keyboard shortcuts

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