Restructure omni services and add Chatwoot research snapshot
This commit is contained in:
9
research/chatwoot/app/helpers/widget_helper.rb
Normal file
9
research/chatwoot/app/helpers/widget_helper.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
module WidgetHelper
|
||||
def build_contact_inbox_with_token(web_widget, additional_attributes = {})
|
||||
contact_inbox = web_widget.create_contact_inbox(additional_attributes)
|
||||
payload = { source_id: contact_inbox.source_id, inbox_id: web_widget.inbox.id }
|
||||
token = ::Widget::TokenService.new(payload: payload).generate_token
|
||||
|
||||
[contact_inbox, token]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user