Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse checks the API response for errors. A response is considered an error if it has a status code outside the 200 range. API error responses map to ErrorResponse.
Types ¶
type AuthTransport ¶
type AuthTransport struct {
Transport http.RoundTripper
Token string
}
AuthTransport holds a authentication information for Postmark API.
type Bounce ¶ added in v0.1.3
type Bounce struct {
ID int64
Type string
TypeCode int64
Name string
Tag string
MessageID string
Description string
Details string
Email string
BouncedAt time.Time
DumpAvailable bool
Inactive bool
CanActivate bool
Subject string
}
Bounce represents a BounceType in further detail.
type BounceDeliveryStats ¶ added in v0.1.2
type BounceDeliveryStats struct {
InactiveMails int64
Bounces []BounceType
}
BounceDeliveryStats represents a collection of bounce stats.
type BounceService ¶ added in v0.1.2
type BounceService service
BounceService handles communication with the bounce related methods of the Postmark API (http://developer.postmarkapp.com/developer-api-bounce.html)
func (*BounceService) GetBounces ¶ added in v0.1.3
func (s *BounceService) GetBounces(bounceCount, bounceOffset int, parameters map[string]interface{}) (*Bounces, *Response, error)
GetBounces will return all bounces.
func (*BounceService) GetDeliveryStats ¶ added in v0.1.2
func (s *BounceService) GetDeliveryStats() (*BounceDeliveryStats, *Response, error)
GetDeliveryStats will return all delivery stats aggregated by bounce type.
type BounceType ¶ added in v0.1.2
BounceType represents the type of bounce with a count.
type Client ¶
type Client struct {
Token string
ConnectionType string
UserAgent string
BackendURL *url.URL
// Services used for communicating with the API.
Email *EmailService
Bounce *BounceService
// contains filtered or unexported fields
}
Client holds a connection to the Postmark API.
func NewClient ¶
NewClient creates a new Client with the appropriate connection details and services used for communicating with the API.
type Email ¶
type Email struct {
From string `json:",omitempty"`
To string `json:",omitempty"`
Cc string `json:",omitempty"`
Bcc string `json:",omitempty"`
Subject string `json:",omitempty"`
Tag string `json:",omitempty"`
TemplateID int `json:",omitempty"`
TemplateModel map[string]interface{} `json:",omitempty"`
HTMLBody string `json:",omitempty"`
TextBody string `json:",omitempty"`
ReplyTo string `json:",omitempty"`
Headers []EmailHeader `json:",omitempty"`
Attachments []EmailAttachment `json:",omitempty"`
TrackOpens bool `json:",omitempty"`
}
Email is the set of parameters that can be used when sending an email.
type EmailAttachment ¶ added in v0.1.1
EmailAttachment represents the values for an email attachment.
type EmailHeader ¶
EmailHeader represents the values for an email header.
type EmailResponse ¶
EmailResponse is the set of parameters that is used in response to a send request
type EmailService ¶
type EmailService service
EmailService handles communication with the email related methods of the Postmark API (http://developer.postmarkapp.com/developer-api-email.html)
func (*EmailService) Send ¶
func (s *EmailService) Send(emailRequest *Email) (*EmailResponse, *Response, error)
Send will build and execute request to send an email via the API.
func (*EmailService) SendBatch ¶
func (s *EmailService) SendBatch(emailRequests []*Email) ([]*EmailResponse, *Response, error)
SendBatch will build and execute request to send batch emails via the API.
type ErrorResponse ¶
An ErrorResponse reports the error caused by an API request
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
batch-emails
command
|
|
|
bounce
command
|
|
|
send-email
command
|
|
|
send-email-attachment
command
|