feat(helpscout): add a tag to messages submited through contact form
This commit is contained in:
parent
a0ce6fa388
commit
b67818e425
2 changed files with 6 additions and 2 deletions
|
@ -54,7 +54,11 @@ class Helpscout::FormAdapter
|
||||||
private
|
private
|
||||||
|
|
||||||
def add_tags(conversation_id)
|
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
|
end
|
||||||
|
|
||||||
def create_conversation
|
def create_conversation
|
||||||
|
|
|
@ -59,7 +59,7 @@ describe Helpscout::FormAdapter do
|
||||||
expect(api).to have_received(:create_conversation)
|
expect(api).to have_received(:create_conversation)
|
||||||
.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 + ['contact form'])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue