mailjet

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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