Documentation ¶
Index ¶
- Variables
- type APIClient
- type CustomerIO
- func (c *CustomerIO) AddDevice(customerID string, deviceID string, platform string, ...) error
- func (c *CustomerIO) Delete(customerID string) error
- func (c *CustomerIO) DeleteDevice(customerID string, deviceID string) error
- func (c *CustomerIO) Identify(customerID string, attributes map[string]interface{}) error
- func (c *CustomerIO) Track(customerID string, eventName string, data map[string]interface{}) error
- func (c *CustomerIO) TrackAnonymous(eventName string, data map[string]interface{}) error
- type CustomerIOError
- type ParamError
- type SendEmailRequest
- type SendEmailResponse
- type TransactionalError
- type TransactionalResponse
Constants ¶
This section is empty.
Variables ¶
var ErrAttachmentExists = errors.New("attachment with this name already exists")
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
func NewAPIClient ¶
NewAPIClient prepares a client for use with the Customer.io API, see: https://customer.io/docs/api/#apicoreintroduction using an App API Key from https://fly.customer.io/settings/api_credentials?keyType=app
func (*APIClient) SendEmail ¶
func (c *APIClient) SendEmail(ctx context.Context, req *SendEmailRequest) (*SendEmailResponse, error)
SendEmail sends a single transactional email using the Customer.io transactional API
type CustomerIO ¶
CustomerIO wraps the customer.io track API, see: https://customer.io/docs/api/#apitrackintroduction
func NewCustomerIO ¶
func NewCustomerIO(siteID, apiKey string) *CustomerIO
NewCustomerIO prepares a client for use with the Customer.io track API, see: https://customer.io/docs/api/#apitrackintroduction deprecated in favour of NewTrackClient
func NewTrackClient ¶
func NewTrackClient(siteID, apiKey string) *CustomerIO
NewTrackClient prepares a client for use with the Customer.io track API, see: https://customer.io/docs/api/#apitrackintroduction using a Tracking Site ID and API Key pair from https://fly.customer.io/settings/api_credentials
func (*CustomerIO) AddDevice ¶ added in v1.1.0
func (c *CustomerIO) AddDevice(customerID string, deviceID string, platform string, data map[string]interface{}) error
AddDevice adds a device for a customer
func (*CustomerIO) Delete ¶
func (c *CustomerIO) Delete(customerID string) error
Delete deletes a customer
func (*CustomerIO) DeleteDevice ¶ added in v1.1.0
func (c *CustomerIO) DeleteDevice(customerID string, deviceID string) error
DeleteDevice deletes a device for a customer
func (*CustomerIO) Identify ¶
func (c *CustomerIO) Identify(customerID string, attributes map[string]interface{}) error
Identify identifies a customer and sets their attributes
func (*CustomerIO) Track ¶
func (c *CustomerIO) Track(customerID string, eventName string, data map[string]interface{}) error
Track sends a single event to Customer.io for the supplied user
func (*CustomerIO) TrackAnonymous ¶ added in v1.1.0
func (c *CustomerIO) TrackAnonymous(eventName string, data map[string]interface{}) error
TrackAnonymous sends a single event to Customer.io for the anonymous user
type CustomerIOError ¶
type CustomerIOError struct {
// contains filtered or unexported fields
}
CustomerIOError is returned by any method that fails at the API level
func (*CustomerIOError) Error ¶
func (e *CustomerIOError) Error() string
type ParamError ¶
type ParamError struct {
Param string // Param is the name of the parameter.
}
ParamError is an error returned if a parameter to the track API is invalid.
func (ParamError) Error ¶
func (e ParamError) Error() string
type SendEmailRequest ¶
type SendEmailRequest struct { MessageData map[string]interface{} `json:"message_data,omitempty"` TransactionalMessageID string `json:"transactional_message_id,omitempty"` Identifiers map[string]string `json:"identifiers"` Headers map[string]string `json:"headers,omitempty"` From string `json:"from,omitempty"` To string `json:"to,omitempty"` ReplyTo string `json:"reply_to,omitempty"` BCC string `json:"bcc,omitempty"` Subject string `json:"subject,omitempty"` Preheader string `json:"preheader,omitempty"` Body string `json:"body,omitempty"` PlaintextBody string `json:"plaintext_body,omitempty"` AMPBody string `json:"amp_body,omitempty"` FakeBCC *bool `json:"fake_bcc,omitempty"` Attachments map[string]string `json:"attachments,omitempty"` DisableMessageRetention *bool `json:"disable_message_retention,omitempty"` SendToUnsubscribed *bool `json:"send_to_unsubscribed,omitempty"` EnableTracking *bool `json:"tracked,omitempty"` QueueDraft *bool `json:"queue_draft,omitempty"` }
type SendEmailResponse ¶
type SendEmailResponse struct {
TransactionalResponse
}
type TransactionalError ¶
type TransactionalError struct { // Err is a more specific error message. Err string // StatusCode is the http status code for the error. StatusCode int }
TransactionalError is returned if a transactional message fails to send.
func (*TransactionalError) Error ¶
func (e *TransactionalError) Error() string
type TransactionalResponse ¶
type TransactionalResponse struct { // DeliveryID is a unique id for the given message. DeliveryID string `json:"delivery_id"` // QueuedAt is when the message was queued. QueuedAt time.Time `json:"queued_at"` }
TransactionalResponse is a response to the send of a transactional message.
func (*TransactionalResponse) UnmarshalJSON ¶
func (t *TransactionalResponse) UnmarshalJSON(b []byte) error