https://github.com/joeshaw/customerio
A Go package for the customer.io email service
https://github.com/joeshaw/customerio
client-lib customerio golang
Last synced: 10 months ago
JSON representation
A Go package for the customer.io email service
- Host: GitHub
- URL: https://github.com/joeshaw/customerio
- Owner: joeshaw
- License: mit
- Created: 2014-07-14T14:12:51.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-14T18:48:06.000Z (about 10 years ago)
- Last Synced: 2025-02-10T11:15:16.591Z (about 1 year ago)
- Topics: client-lib, customerio, golang
- Language: Go
- Size: 10.7 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](http://customer.io/docs/api/rest.html).
Full API docs are available on
[godoc](http://godoc.org/github.com/joeshaw/customerio).
```go
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`.