Help us shape the future of Go! Take the 2026 Go Developer Survey

postmark

package module
v0.0.0-...-f3e85c5 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2015 License: MIT Imports: 7 Imported by: 0

README

Postmark

Go library for Postmark API.

WIP

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Name        string `json:"Name"`
	Content     []byte `json:"Content"`
	ContentType string `json:"ContentType"`
}

type Client

type Client interface {
	Email(*Email) (*EmailResponse, error)
	EmailBatch([]*Email) ([]*EmailResponse, error)
}

func NewClient

func NewClient(ServerToken string) Client

type Email

type Email struct {
	From        string       `json:"From"`
	To          string       `json:"To"`
	Cc          string       `json:"Cc,omitempty"`
	Bcc         string       `json:"Bcc,omitempty"`
	Subject     string       `json:"Subject,omitempty"`
	Tag         string       `json:"Tag,omitempty"`
	HtmlBody    string       `json:"HtmlBody"`
	TextBody    string       `json:"TextBody"`
	ReplyTo     string       `json:"ReplyTo,omitempty"`
	Headers     []Header     `json:"Headers,omitempty"`
	TrackOpens  bool         `json:"TrackOpens,omitempty"`
	Attachments []Attachment `json:"Attachments,omitempty"`
}

func (*Email) AddAttachment

func (e *Email) AddAttachment(Name string, Content []byte, ContentType string)

func (*Email) AddAttachmentReader

func (e *Email) AddAttachmentReader(Name string, Content io.Reader, ContentType string) error

func (*Email) AddHeader

func (e *Email) AddHeader(Name, Value string)

func (*Email) DelAttachment

func (e *Email) DelAttachment(Name string) bool

func (*Email) DelHeader

func (e *Email) DelHeader(Name string) bool

type EmailResponse

type EmailResponse struct {
	To          string    `json:"To"`
	SubmittedAt time.Time `json:"SubmittedAt"`
	MessageID   string    `json:"MessageID"`
	ErrorCode   int       `json:"ErrorCode"`
	Message     string    `json:"Message"`
}

type Error

type Error struct {
	ErrorCode int    `json:"ErrorCode"`
	Message   string `json:"Message"`
}

func (*Error) Error

func (e *Error) Error() string
type Header struct {
	Name  string `json:"Name"`
	Value string `json:"Value"`
}

Jump to

Keyboard shortcuts

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