Documentation ¶
Overview ¶
Package customerio is a wrapper around the Customer.io REST API, documented at http://customer.io/docs/api/rest.html
Index ¶
- func NewContext(ctx context.Context, c *Client) context.Context
- type Client
- func (c *Client) Delete(id string) error
- func (c *Client) Identify(id string, email string, attrs map[string]interface{}) error
- func (c *Client) Track(id string, eventName string, attrs map[string]interface{}) error
- func (c *Client) TrackRecipient(recipient, eventName string, attrs map[string]interface{}) error
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { SiteID string APIKey string // The http.Client used to make connections to the Customer.io // REST API. You may use your own or http.DefaultClient. HTTPClient *http.Client }
Client represents a client to the Customer.io REST API.
func FromContext ¶
FromContext returns the *Client associated with a context.Context, if any. Otherwise a nil *Client is returned.
func (*Client) Delete ¶
Delete will remove a customer, and all their information from Customer.io. The REST endpoint is documented here: http://customer.io/docs/api/rest.html#section-Deleting_customers
func (*Client) Identify ¶
Identify creates or updates a customer. id is a unique, non-email identifier for a customer. The attrs map may be nil, or contain attributes which Customer.io can use to personalize triggered emails or affect the logic of who receives them. The REST endpoint is documented here: http://customer.io/docs/api/rest.html#section-Creating_or_updating_customers
func (*Client) Track ¶
Track will send an event to Customer.io. The attrs map may be nil, or contain any information to attach to this event. These attributes can be used in triggers to control who should receive triggered email. The REST endpoint is documented here: http://customer.io/docs/api/rest.html#section-Track_a_custom_event
func (*Client) TrackRecipient ¶
Sends an event email to a address that is not associated with a user in Customer.io. The attrs may be nil, and recipient will be assigned to "recipient" within it. The REST endpoint is documented here: http://customer.io/docs/invitation-emails.html
type Error ¶
type Error struct {
StatusCode int
}
Error represents an error from the Customer.io API, containing an HTTP status code returned by the request. Errors are documented in the REST API here: http://customer.io/docs/api/rest.html#section-Errors