sparkpost

package
v0.0.0-...-116aade Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = log.New()

Log represents logger.

Functions

This section is empty.

Types

type Address

type Address struct {
	Name     string `json:"name,omitempty"`
	Email    string `json:"email"`
	HeaderTo string `json:"header_to,omitempty"`
}

Address is SparkPost' address part.

type Content

type Content struct {
	From    Address           `json:"from,omitempty"`
	Headers map[string]string `json:"headers,omitempty"`
	Subject string            `json:"subject,omitempty"`
	Text    string            `json:"text,omitempty"`
	HTML    string            `json:"html,omitempty"`
}

Content defines SparkPost' content.

type Message

type Message struct {
	ReturnPath string      `json:"return_path,omitempty"`
	Recipients []Recipient `json:"recipients,omitempty"`
	Content    Content     `json:"content,omitempt"`
}

Message defines SparkPost' message.

type Recipient

type Recipient struct {
	Address Address `json:"address"`
}

Recipient defines SparkPost' recipient.

type SparkPost

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

SparkPost defines SparkPost transactional mail provider.

func New

func New(key string) (*SparkPost, error)

New returns new SparkPost instance. API key is validated upon creation, returning error if key is not valid.

func (*SparkPost) Send

func (sp *SparkPost) Send(msg *message.Message, async bool) (interface{}, error)

Send sends provided message in async or sync way.

Jump to

Keyboard shortcuts

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