customerio / customerio-ruby

A ruby client for the Customer.io event API.
https://customer.io/docs/api/
MIT License
65 stars 75 forks source link

Add support to identify customers by email instead of always requiring an ID #87

Closed RobertWSaunders closed 2 years ago

RobertWSaunders commented 2 years ago

The docs and API allow you to identify people with only an email if the customer is not a fully onboarded user yet (i.e. a lead). However, if you try to identify a user through the library and don't supply a id it errors out, specifically at this line of code.

Right now I am getting around this issue by not using the client and instead using the API directly. It would be nice if I didn't have to do that. Happy to make the code change but it looks like other contributors PRs aren't being merged?

RobertWSaunders commented 2 years ago

Never mind, turns out you can do:

CustomerIOClient.instance.track_client.identify({ id: "leah@test.com" })

I thought id had to be a number 🤦