A Go package for the customer.io email service
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE add MIT license Jul 22, 2014
README.md comment the API calls in the README Jul 14, 2014
customerio.go in Identify(), don't send email if it's unset Jan 14, 2016
customerio_test.go

README.md

customerio

customerio is a Go package for integration with the Customer.io email service.

Install

go get github.com/joeshaw/customerio

API

The API is built on top of the Customer.io REST API.

Full API docs are available on godoc.

c := customerio.Client{
    SiteID: "my-site-id",
    APIKey: "my-api-key",
    HTTPClient: http.DefaultClient,
}

// Create a new customer with ID 5, email address customer@example.com,
// and a couple custom attributes
err := c.Identify("5", "customer@example.com", map[string]interface{}{
    "name": "Bob",
    "plan": "premium",
})
if err != nil {
    // uh oh
}

// Track an event named "purchased" on customer ID 5, with some custom
// event attributes.
err = c.Track("5", "purchased", map[string]interface{}{
    "price": 23.45,
}
if err != nil {
    // uh oh
}

You may pass in a nil map to either Identify or Track.