helpscout: remove integration of custom fields

Our new HelpScout plan doesn't allow custom fields
anymore.
This commit is contained in:
Pierre de La Morinerie 2019-05-13 11:55:32 +02:00
parent e4517c7e98
commit e66e78b4db
3 changed files with 0 additions and 21 deletions

View file

@ -22,17 +22,6 @@ class Helpscout::API
})
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)
body = {
subject: subject,

View file

@ -41,8 +41,6 @@ class Helpscout::FormAdapter
if conversation_id.present?
add_tags(conversation_id)
add_custom_fields(conversation_id)
true
else
false
@ -55,10 +53,6 @@ class Helpscout::FormAdapter
@api.add_tags(conversation_id, params[:tags])
end
def add_custom_fields(conversation_id)
@api.add_custom_fields(conversation_id, params[:dossier_id], params[:browser])
end
def create_conversation
response = @api.create_conversation(
params[:email],

View file

@ -62,8 +62,6 @@ describe Helpscout::FormAdapter do
.with(email, subject, text, nil)
expect(api).to have_received(:add_tags)
.with(conversation_id, tags)
expect(api).to have_received(:add_custom_fields)
.with(conversation_id, nil, nil)
end
end
@ -102,8 +100,6 @@ describe Helpscout::FormAdapter do
.with(email, subject, text, nil)
expect(api).to have_received(:add_phone_number)
.with(email, phone)
expect(api).to have_received(:add_custom_fields)
.with(conversation_id, nil, nil)
end
end
end