helpscout: remove integration of custom fields
Our new HelpScout plan doesn't allow custom fields anymore.
This commit is contained in:
parent
e4517c7e98
commit
e66e78b4db
3 changed files with 0 additions and 21 deletions
|
@ -22,17 +22,6 @@ class Helpscout::API
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_custom_fields(conversation_id, dossier_id, browser)
|
|
||||||
body = {
|
|
||||||
'Dossier ID': dossier_id,
|
|
||||||
'Browser': browser
|
|
||||||
}.compact.map do |key, value|
|
|
||||||
{ id: custom_fields[key], value: value }
|
|
||||||
end
|
|
||||||
|
|
||||||
call_api(:put, "#{CONVERSATIONS}/#{conversation_id}/#{FIELDS}", { fields: body })
|
|
||||||
end
|
|
||||||
|
|
||||||
def create_conversation(email, subject, text, file)
|
def create_conversation(email, subject, text, file)
|
||||||
body = {
|
body = {
|
||||||
subject: subject,
|
subject: subject,
|
||||||
|
|
|
@ -41,8 +41,6 @@ class Helpscout::FormAdapter
|
||||||
|
|
||||||
if conversation_id.present?
|
if conversation_id.present?
|
||||||
add_tags(conversation_id)
|
add_tags(conversation_id)
|
||||||
add_custom_fields(conversation_id)
|
|
||||||
|
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
|
@ -55,10 +53,6 @@ class Helpscout::FormAdapter
|
||||||
@api.add_tags(conversation_id, params[:tags])
|
@api.add_tags(conversation_id, params[:tags])
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_custom_fields(conversation_id)
|
|
||||||
@api.add_custom_fields(conversation_id, params[:dossier_id], params[:browser])
|
|
||||||
end
|
|
||||||
|
|
||||||
def create_conversation
|
def create_conversation
|
||||||
response = @api.create_conversation(
|
response = @api.create_conversation(
|
||||||
params[:email],
|
params[:email],
|
||||||
|
|
|
@ -62,8 +62,6 @@ describe Helpscout::FormAdapter do
|
||||||
.with(email, subject, text, nil)
|
.with(email, subject, text, nil)
|
||||||
expect(api).to have_received(:add_tags)
|
expect(api).to have_received(:add_tags)
|
||||||
.with(conversation_id, tags)
|
.with(conversation_id, tags)
|
||||||
expect(api).to have_received(:add_custom_fields)
|
|
||||||
.with(conversation_id, nil, nil)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -102,8 +100,6 @@ describe Helpscout::FormAdapter do
|
||||||
.with(email, subject, text, nil)
|
.with(email, subject, text, nil)
|
||||||
expect(api).to have_received(:add_phone_number)
|
expect(api).to have_received(:add_phone_number)
|
||||||
.with(email, phone)
|
.with(email, phone)
|
||||||
expect(api).to have_received(:add_custom_fields)
|
|
||||||
.with(conversation_id, nil, nil)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue