Merge pull request #6739 from tchak/feat-helpscout-tags

feat(helpscout): add a tag to messages submited through contact form
This commit is contained in:
Paul Chavard 2021-12-09 12:00:40 +01:00 committed by GitHub
commit 0a96e2f5a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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