diff --git a/.env.example b/.env.example index 3a5600495..dd4052f69 100644 --- a/.env.example +++ b/.env.example @@ -101,7 +101,7 @@ FB_APP_SECRET= FB_APP_ID= # https://developers.facebook.com/docs/messenger-platform/instagram/get-started#app-dashboard -IG_VERIFY_TOKEN +IG_VERIFY_TOKEN= # Twitter # documentation: https://www.chatwoot.com/docs/twitter-app-setup diff --git a/app/controllers/api/v1/accounts/inboxes_controller.rb b/app/controllers/api/v1/accounts/inboxes_controller.rb index df055923c..3f8686499 100644 --- a/app/controllers/api/v1/accounts/inboxes_controller.rb +++ b/app/controllers/api/v1/accounts/inboxes_controller.rb @@ -96,6 +96,8 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController Current.account.line_channels.create!(permitted_params(Channel::Line::EDITABLE_ATTRS)[:channel].except(:type)) when 'telegram' Current.account.telegram_channels.create!(permitted_params(Channel::Telegram::EDITABLE_ATTRS)[:channel].except(:type)) + when 'whatsapp' + Current.account.whatsapp_channels.create!(permitted_params(Channel::Whatsapp::EDITABLE_ATTRS)[:channel].except(:type)) end end diff --git a/app/controllers/webhooks/whatsapp_controller.rb b/app/controllers/webhooks/whatsapp_controller.rb new file mode 100644 index 000000000..7560da1e4 --- /dev/null +++ b/app/controllers/webhooks/whatsapp_controller.rb @@ -0,0 +1,6 @@ +class Webhooks::WhatsappController < ActionController::API + def process_payload + Webhooks::WhatsappEventsJob.perform_later(params.to_unsafe_hash) + head :ok + end +end diff --git a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue index c84b14b01..db042b5b7 100644 --- a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue +++ b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue @@ -1,7 +1,7 @@