customerio / customerio-ruby

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

Allow id and email identifiers to be updated when cio_id specified #109

Closed richdawe-cio closed 7 months ago

richdawe-cio commented 7 months ago

This is an alternative solution to https://github.com/customerio/customerio-ruby/issues/78 . It's an alternative to the solution implemented in https://github.com/customerio/customerio-ruby/pull/102 .

This PR updates the identify operation to use the cio_id to identify customers, if it's present. This will allow users of the client library to update customers using the existing identify call by passing in the cio_id, and whatever attributes they want. This may include the id (external ID) or email, but those would not be required.

Changing the id and email for a customer with cio_id of "f000000d" would then look like this:

$customerio.identify(
  :cio_id => "f000000d",
  :id => 1005,
  :email => "bob.fullname@example.com"
)