README.md in intercom-2.4.4 vs README.md in intercom-2.5.4
- old
+ new
@@ -17,11 +17,11 @@
gem install intercom
Using bundler:
- gem 'intercom', "~> 2.4.4"
+ gem 'intercom', "~> 2.5.4"
## Basic Usage
### Configure your access credentials
@@ -60,10 +60,12 @@
user = Intercom::User.find(:user_id => "1")
# Find user by id
user = Intercom::User.find(:id => "1")
# Create a user
user = Intercom::User.create(:email => "bob@example.com", :name => "Bob Smith", :signed_up_at => Time.now.to_i)
+# Delete a user
+deleted_user = Intercom::User.find(:id => "1").delete
# Update custom_attributes for a user
user.custom_attributes["average_monthly_spend"] = 1234.56; user.save
# Perform incrementing
user.increment('karma'); user.save
# Iterate over all users
@@ -293,9 +295,27 @@
The metadata key values in the example are treated as follows-
- order_date: a Date (key ends with '_date').
- stripe_invoice: The identifier of the Stripe invoice (has a 'stripe_invoice' key)
- order_number: a Rich Link (value contains 'url' and 'value' keys)
- price: An Amount in US Dollars (value contains 'amount' and 'currency' keys)
+
+*NB:* This version of the gem reserves the field name `type` in Event data.
+
+### Contacts
+
+`Contacts` represent logged out users of your application.
+
+```ruby
+# Create a contact
+contact = Intercom::Contact.create(email: "some_contact@example.com")
+
+# Update a contact
+contact.custom_attributes['foo'] = 'bar'
+contact.save
+
+# Find contacts by email
+contacts = Intercom::Contact.find_all(email: "some_contact@example.com")
+```
### Subscriptions
Subscribe to events in Intercom to receive webhooks.