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 Client ¶
type Client struct {
Token string
ConnectionType string
UserAgent string
BackendURL *url.URL
// Services used for communicating with the API.
Email *EmailService
// 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"`
TrackOpens bool `json:",omitempty"`
}
Email is the set of parameters that can be used when sending an email.
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