client

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2019 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Enabled() bool
	SendEmail(context.Context, *Email) error
}

App of package

func New

func New(config Config) App

New creates new App from Config

type Config

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

Config of package

func Flags

func Flags(fs *flag.FlagSet, prefix string) Config

Flags adds flags for configuring package

type Email

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

Email describes an email to be sent

func NewEmail

func NewEmail(mailer App) *Email

NewEmail create a new email

func (*Email) As

func (e *Email) As(sender string) *Email

As set sender

func (*Email) Data

func (e *Email) Data(data interface{}) *Email

Data set payload

func (*Email) From

func (e *Email) From(from string) *Email

From set from

func (*Email) Send

func (e *Email) Send(ctx context.Context) error

Send email

func (*Email) Template

func (e *Email) Template(template string) *Email

Template set template

func (*Email) To

func (e *Email) To(recipients ...string) *Email

To add recipients to list

func (*Email) WithSubject

func (e *Email) WithSubject(subject string) *Email

WithSubject set subject

Jump to

Keyboard shortcuts

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