sparkpost

package module
v0.0.0-...-4e1a02e Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2016 License: MIT Imports: 11 Imported by: 0

README

sparkpost

SparkPost lib that supports the subset of API operations we use internally.

Install

go get github.com/altipla-consulting/sparkpost

Documentation

GoDoc

Contributing

You can make pull requests or create issues in GitHub. Any code you send should be formatted using gofmt.

License

New code is under the MIT License. Large parts of the format code are extracted from the Go standard library under a BSD License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDKIMKey

func GenerateDKIMKey() (string, string, error)

GenerateDKIMKey generates a RSA key suitable for DKIM signing and return the private key, the public key and the error.

Types

type CallError

type CallError struct {
	Errors []Error `json:"errors"`
}

func (*CallError) Error

func (err *CallError) Error() string

type Client

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

func NewClient

func NewClient(apiKey string) *Client

func (*Client) CreateSendingDomain

func (c *Client) CreateSendingDomain(domain *SendingDomain) error

func (*Client) CreateTransmissionFromTemplate

func (c *Client) CreateTransmissionFromTemplate(transmission Transmission) error

func (*Client) VerifySendingDomain

func (c *Client) VerifySendingDomain(domain string) (*VerificationStatus, error)

type Error

type Error struct {
	Message     string `json:"message"`
	Description string `json:"description"`
	Code        string `json:"code"`
}

type Recipient

type Recipient struct {
	Name  string
	Email string
}

type SendingDomain

type SendingDomain struct {
	Domain string             `json:"domain"`
	DKIM   *SendingDomainDKIM `json:"dkim"`
}

type SendingDomainDKIM

type SendingDomainDKIM struct {
	Private string `json:"private"`
	Public  string `json:"public"`

	// Subdomain that will be used to verify; e.g.: scph0316
	Selector string `json:"selector"`

	// Colon separated list of headers to sign. SparkPost UI by default uses "from:to:subject:date"
	Headers string `json:"headers"`
}

type Transmission

type Transmission struct {
	TemplateID       string
	SubstitutionData interface{}
	Recipients       []Recipient
	Tags             []string
	ReplyTo          string
}

type VerificationStatus

type VerificationStatus struct {
	SPFStatus  string
	SPFError   string
	DKIMStatus string
	DKIMError  string
}

Jump to

Keyboard shortcuts

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