Last active
October 28, 2022 17:02
-
-
Save begin29/cc03de241c235b71bebbaf29027c2e4d to your computer and use it in GitHub Desktop.
identify/create customer and trigger event on customer_io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def user_params(user) | |
{ | |
id: user.cio_id, | |
first_name: user.first_name, | |
last_name: user.last_name, | |
email: user.email, | |
} | |
end | |
cio_client = Customerio::Client.new(ENV['CUSTOMER_IO_SITE_ID'], ENV['CUSTOMER_IO_API_KEY']) | |
res = cio_client.identify(user_params(User.new(email: '[email protected]', first_name: 'Dr', last_name: 'FeelGood', cio_id: 'u-9999'))) | |
cio_client.track('u-9999', 'test-trigger', {test_key: 'test'}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment