intercom 3.7.0 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/intercom/service/conversation.rb +6 -0
- data/lib/intercom/version.rb +1 -1
- data/spec/unit/intercom/conversation_spec.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c14b4a3123f4e82d7f6f4df68f218132d2396a8
|
4
|
+
data.tar.gz: fac1eb6ee0010b4916e1d9267f39271309d44a44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e730159e675f826a7d32d1424627aa3bbff7b1d06ead12d632a0a6f7cbd76aa3c38f36ea51d6e39209a3a1e447c7c3a3015d44e80a599db3f416337ff2d114c
|
7
|
+
data.tar.gz: 11c8ca1713ef09f8053a020f0bc24fc7de0bacc3dbe4dffce761409f67d3e89e2bf271e2ca4f38b7796a32bb0730d40c35c6ee9ef4dd5d790adeff41669af4a3
|
data/README.md
CHANGED
@@ -225,6 +225,9 @@ intercom.conversations.reply(id: conversation.id, type: 'admin', admin_id: '123'
|
|
225
225
|
# User (identified by email) replies with a comment and attachment
|
226
226
|
intercom.conversations.reply(id: conversation.id, type: 'user', email: 'joe@example.com', message_type: 'comment', body: 'foo', attachment_urls: ['http://www.example.com/attachment.jpg'])
|
227
227
|
|
228
|
+
#reply to a user's last conversation
|
229
|
+
intercom.conversations.reply_to_last(type: 'user', body: 'Thanks again', message_type: 'comment', user_id: '12345', admin_id: '123')
|
230
|
+
|
228
231
|
# Open
|
229
232
|
intercom.conversations.open(id: conversation.id, admin_id: '123')
|
230
233
|
|
@@ -245,6 +248,12 @@ intercom.conversations.reply(id: conversation.id, type: 'admin', admin_id: '123'
|
|
245
248
|
# Reply and Close
|
246
249
|
intercom.conversations.reply(id: conversation.id, type: 'admin', admin_id: '123', message_type: 'close', body: 'bar')
|
247
250
|
|
251
|
+
# Admin reply to last conversation
|
252
|
+
intercom.conversations.reply_to_last(intercom_user_id: '5678', type: 'admin', admin_id: '123', message_type: 'comment', body: 'bar')
|
253
|
+
|
254
|
+
# User reply to last conversation
|
255
|
+
intercom.conversations.reply_to_last(intercom_user_id: '5678', type: 'user', message_type: 'comment', body: 'bar')
|
256
|
+
|
248
257
|
# ASSIGNING CONVERSATIONS TO ADMINS
|
249
258
|
intercom.conversations.reply(id: conversation.id, type: 'admin', assignee_id: assignee_admin.id, admin_id: admin.id, message_type: 'assignment')
|
250
259
|
|
@@ -29,6 +29,12 @@ module Intercom
|
|
29
29
|
collection_class.new.from_response(response)
|
30
30
|
end
|
31
31
|
|
32
|
+
def reply_to_last(reply_data)
|
33
|
+
collection_name = Utils.resource_class_to_collection_name(collection_class)
|
34
|
+
response = @client.post("/#{collection_name}/last/reply", reply_data)
|
35
|
+
collection_class.new.from_response(response)
|
36
|
+
end
|
37
|
+
|
32
38
|
def open(reply_data)
|
33
39
|
reply reply_data.merge(message_type: 'open', type: 'admin')
|
34
40
|
end
|
data/lib/intercom/version.rb
CHANGED
@@ -28,6 +28,11 @@ describe "Intercom::Conversation" do
|
|
28
28
|
client.conversations.reply(id: '147', type: 'user', body: 'Thanks again', message_type: 'comment', user_id: 'ac4', attachment_urls: ["http://www.example.com/attachment.jpg"])
|
29
29
|
end
|
30
30
|
|
31
|
+
it 'sends a reply to a users last conversation from an admin' do
|
32
|
+
client.expects(:post).with('/conversations/last/reply', { type: 'admin', body: 'Thanks again', message_type: 'comment', user_id: 'ac4', admin_id: '123' }).returns(test_conversation)
|
33
|
+
client.conversations.reply_to_last(type: 'admin', body: 'Thanks again', message_type: 'comment', user_id: 'ac4', admin_id: '123')
|
34
|
+
end
|
35
|
+
|
31
36
|
it 'opens a conversation' do
|
32
37
|
client.expects(:post).with('/conversations/147/reply', { type: 'admin', message_type: 'open', conversation_id: '147', admin_id: '123'}).returns(test_conversation)
|
33
38
|
client.conversations.open(id: '147', admin_id: '123')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intercom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.7.
|
4
|
+
version: 3.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben McRedmond
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2018-11-
|
18
|
+
date: 2018-11-21 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: minitest
|
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
230
|
version: '0'
|
231
231
|
requirements: []
|
232
232
|
rubyforge_project: intercom
|
233
|
-
rubygems_version: 2.6.14
|
233
|
+
rubygems_version: 2.6.14
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: Ruby bindings for the Intercom API
|