mailjet

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoConfiguration occurs when configuration is missing
	ErrNoConfiguration = errors.New("no configuration for mailjet")

	// ErrEmptyFrom occurs when from parameter is empty
	ErrEmptyFrom = errors.New("\"from\" parameter is empty")

	// ErrEmptyTo occurs when to parameter is empty
	ErrEmptyTo = errors.New("\"to\" parameter is empty")

	// ErrBlankTo occurs when a to recipient is blank
	ErrBlankTo = errors.New("\"to\" item is blank")
)

Functions

This section is empty.

Types

type App

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

App of package

func New

func New(config Config) *App

New creates new App from Config

func (App) CheckParameters

func (a App) CheckParameters(mail *Mail) error

CheckParameters checks mail descriptor

func (App) GetParameters

func (a App) GetParameters(r *http.Request) *Mail

GetParameters retrieves mail descriptor from Query

func (App) SendMail

func (a App) SendMail(ctx context.Context, mail *Mail, html string) error

SendMail send mailjet mail

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 Mail

type Mail struct {
	From    string      `json:"FromEmail"`
	Sender  string      `json:"FromName"`
	Subject string      `json:"Subject"`
	To      []Recipient `json:"Recipients"`
	HTML    string      `json:"Html-part"`
}

Mail descriptor

type Recipient

type Recipient struct {
	Email string `json:"Email"`
}

Recipient of an email

type Response

type Response struct {
	Sent []Recipient `json:"Sent"`
}

Response from Mailjet

Jump to

Keyboard shortcuts

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