README.md in intercom-3.5.25 vs README.md in intercom-3.5.26
- old
+ new
@@ -189,10 +189,15 @@
intercom.conversations.find_all(email: 'joe@example.com', type: 'user').each {|convo| ... }
# Iterate over through all conversations (read + unread) with a user based on the users email
intercom.conversations.find_all(email: 'joe@example.com', type: 'user', unread: false).each {|convo| ... }
# Iterate over all unread conversations with a user based on the users email
intercom.conversations.find_all(email: 'joe@example.com', type: 'user', unread: true).each {|convo| ... }
+# Iterate over all conversations for a user with their Intercom user ID
+intercom.conversations.find_all(intercom_user_id: '536e564f316c83104c000020', type: 'user').each {|convo| ... }
+# Iterate over all conversations for a lead
+# NOTE: to iterate over a lead's conversations you MUST use their Intercom User ID and type User
+intercom.conversations.find_all(intercom_user_id: lead.id, type: 'user').each {|convo| ... }
# FINDING A SINGLE CONVERSATION
conversation = intercom.conversations.find(id: '1')
# INTERACTING WITH THE PARTS OF A CONVERSATION
@@ -367,11 +372,34 @@
intercom.contacts.save(contact)
# Find contacts by email
contacts = intercom.contacts.find_all(email: "some_contact@example.com")
+# Using find to search for contacts by email
+contact_list = intercom.contacts.find(email: "some_contact@example.com")
+# This returns a Contact object with type contact.list
+# Note: Multiple contacts can be returned in this list if there are multiple matching contacts found
+# #<Intercom::Contact:0x00007ff3a80789f8
+# @changed_fields=#<Set: {}>,
+# @contacts=
+# [{"type"=>"contact",
+# "id"=>"5b7fd9b683681ac52274b9c7",
+# "user_id"=>"05bc4d17-72cc-433e-88ae-0bf88db5d0e6",
+# "anonymous"=>true,
+# "email"=>"some_contact@example.com",
+# ...}],
+# @custom_attributes={},
+# @limited=false,
+# @pages=#<Intercom::Pages:0x00007ff3a7413c58 @changed_fields=#<Set: {}>, @next=nil, @page=1, @per_page=50, @total_pages=1, @type="pages">,
+# @total_count=1,
+# @type="contact.list">
+# Access the contact's data
+contact_list.contacts.first
+
# Convert a contact into a user
-intercom.contacts.convert(contact, user)
+contact = intercom.contacts.find(id: "536e564f316c83104c000020")
+intercom.contacts.convert(contact, Intercom::User.new(email: email))
+# Using find with email will not work here. See https://github.com/intercom/intercom-ruby/issues/419 for more information
# Delete a contact
intercom.contacts.delete(contact)
# Get a large list of contacts using scroll