astisparkpost

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: MIT Imports: 7 Imported by: ? 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.

README

// TODO

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Key = flag.String("sparkpost-key", "", "the SparkPost key")
)

Flags

Functions

This section is empty.

Types

type Address

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

type Attachment

type Attachment struct {
	Data string `json:"data,omitempty"`
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

type Client

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

Client represents the client

func New

func New(c Configuration) *Client

New creates a new client

func (*Client) CreateTransmission

func (c *Client) CreateTransmission(t Transmission) (r TransmissionResults, err error)

CreateLink creates a link

type Configuration

type Configuration struct {
	Key    string `toml:"key"`
	Sender astikit.HTTPSenderOptions
}

Configuration represents the lib's configuration

func FlagConfig

func FlagConfig() Configuration

FlagConfig generates a Configuration based on flags

type Error

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

type ErrorPayload

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

type Headers

type Headers map[string]string

type InlineContent

type InlineContent struct {
	Attachments  []Attachment  `json:"attachments,omitempty"`
	From         *Address      `json:"from,omitempty"`
	Headers      *Headers      `json:"headers,omitempty"`
	HTML         string        `json:"html,omitempty"`
	InlineImages []InlineImage `json:"inline_images,omitempty"`
	ReplyTo      string        `json:"reply_to,omitempty"`
	Subject      string        `json:"subject,omitempty"`
	TemplateID   string        `json:"template_id,omitempty"`
	Text         string        `json:"text,omitempty"`
}

type InlineImage

type InlineImage struct {
	Data string `json:"data,omitempty"`
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

type Metadata

type Metadata map[string]string

type Recipient

type Recipient struct {
	Address          *Address          `json:"address,omitempty"`
	Metadata         *Metadata         `json:"metadata,omitempty"`
	ReturnPath       string            `json:"return_path,omitempty"`
	SubstitutionData *SubstitutionData `json:"substitution_data,omitempty"`
	Tags             []string          `json:"tags,omitempty"`
}

type SubstitutionData

type SubstitutionData map[string]interface{}

type Transmission

type Transmission struct {
	CampaignID       string               `json:"campaign_id,omitempty"`
	Content          *InlineContent       `json:"content,omitempty"`
	Description      string               `json:"description,omitempty"`
	Metadata         *Metadata            `json:"metadata,omitempty"`
	Options          *TransmissionOptions `json:"options,omitempty"`
	Recipients       []Recipient          `json:"recipients,omitempty"`
	ReturnPath       string               `json:"return_path,omitempty"`
	SubstitutionData *SubstitutionData    `json:"substitution_data,omitempty"`
}

type TransmissionOptions

type TransmissionOptions struct {
	ClickTracking *bool `json:"click_tracking,omitempty"`
	Sandbox       *bool `json:"sandbox,omitempty"`
}

type TransmissionResults

type TransmissionResults struct {
	ID                      string `json:"id"`
	TotalAcceptedRecipients int    `json:"total_accepted_recipients"`
	TotalRejectedRecipients int    `json:"total_rejected_recipients"`
}

Jump to

Keyboard shortcuts

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