feat(helpscout): add a tag to messages submited through contact form

This commit is contained in:
Paul Chavard 2021-12-09 11:23:03 +01:00
parent a0ce6fa388
commit b67818e425
2 changed files with 6 additions and 2 deletions

View file

@ -54,7 +54,11 @@ class Helpscout::FormAdapter
private
def add_tags(conversation_id)
@api.add_tags(conversation_id, params[:tags])
@api.add_tags(conversation_id, tags)
end
def tags
(params[:tags].presence || []) + ['contact form']
end
def create_conversation

View file

@ -59,7 +59,7 @@ describe Helpscout::FormAdapter do
expect(api).to have_received(:create_conversation)
.with(email, subject, text, nil)
expect(api).to have_received(:add_tags)
.with(conversation_id, tags)
.with(conversation_id, tags + ['contact form'])
end
end