2020-07-21 06:45:24 +00:00
|
|
|
json.id resource.id
|
2021-09-14 17:14:53 +00:00
|
|
|
json.avatar_url resource.try(:avatar_url)
|
2020-07-21 06:45:24 +00:00
|
|
|
json.channel_id resource.channel_id
|
|
|
|
json.name resource.name
|
|
|
|
json.channel_type resource.channel_type
|
|
|
|
json.greeting_enabled resource.greeting_enabled
|
|
|
|
json.greeting_message resource.greeting_message
|
2021-02-23 06:41:15 +00:00
|
|
|
json.working_hours_enabled resource.working_hours_enabled
|
2021-06-10 09:34:03 +00:00
|
|
|
json.enable_email_collect resource.enable_email_collect
|
2021-07-05 05:37:02 +00:00
|
|
|
json.csat_survey_enabled resource.csat_survey_enabled
|
2021-09-14 17:14:53 +00:00
|
|
|
json.enable_auto_assignment resource.enable_auto_assignment
|
2022-06-13 14:48:38 +00:00
|
|
|
json.auto_assignment_config resource.auto_assignment_config
|
2021-09-14 17:14:53 +00:00
|
|
|
json.out_of_office_message resource.out_of_office_message
|
2021-02-23 06:41:15 +00:00
|
|
|
json.working_hours resource.weekly_schedule
|
|
|
|
json.timezone resource.timezone
|
2021-09-14 17:14:53 +00:00
|
|
|
json.callback_webhook_url resource.callback_webhook_url
|
2022-01-11 08:32:03 +00:00
|
|
|
json.allow_messages_after_resolved resource.allow_messages_after_resolved
|
2022-11-25 10:01:04 +00:00
|
|
|
json.lock_to_single_conversation resource.lock_to_single_conversation
|
2021-12-15 18:54:50 +00:00
|
|
|
|
2021-09-14 17:14:53 +00:00
|
|
|
## Channel specific settings
|
|
|
|
## TODO : Clean up and move the attributes into channel sub section
|
|
|
|
|
2022-11-25 10:01:04 +00:00
|
|
|
json.tweets_enabled resource.channel.try(:tweets_enabled) if resource.twitter?
|
|
|
|
|
2021-09-14 17:14:53 +00:00
|
|
|
## WebWidget Attributes
|
2020-07-21 06:45:24 +00:00
|
|
|
json.widget_color resource.channel.try(:widget_color)
|
|
|
|
json.website_url resource.channel.try(:website_url)
|
2021-10-08 07:23:24 +00:00
|
|
|
json.hmac_mandatory resource.channel.try(:hmac_mandatory)
|
2020-07-21 06:45:24 +00:00
|
|
|
json.welcome_title resource.channel.try(:welcome_title)
|
|
|
|
json.welcome_tagline resource.channel.try(:welcome_tagline)
|
|
|
|
json.web_widget_script resource.channel.try(:web_widget_script)
|
2021-02-15 07:38:15 +00:00
|
|
|
json.website_token resource.channel.try(:website_token)
|
2020-08-05 12:16:17 +00:00
|
|
|
json.selected_feature_flags resource.channel.try(:selected_feature_flags)
|
2020-10-18 18:02:22 +00:00
|
|
|
json.reply_time resource.channel.try(:reply_time)
|
2021-02-15 19:28:57 +00:00
|
|
|
if resource.web_widget?
|
|
|
|
json.hmac_token resource.channel.try(:hmac_token)
|
|
|
|
json.pre_chat_form_enabled resource.channel.try(:pre_chat_form_enabled)
|
|
|
|
json.pre_chat_form_options resource.channel.try(:pre_chat_form_options)
|
2022-01-26 23:59:48 +00:00
|
|
|
json.continuity_via_email resource.channel.try(:continuity_via_email)
|
2021-02-15 19:28:57 +00:00
|
|
|
end
|
2021-09-14 17:14:53 +00:00
|
|
|
|
|
|
|
## Facebook Attributes
|
2022-01-26 23:59:48 +00:00
|
|
|
if resource.facebook?
|
|
|
|
json.page_id resource.channel.try(:page_id)
|
|
|
|
json.reauthorization_required resource.channel.try(:reauthorization_required?)
|
|
|
|
end
|
2021-09-14 17:14:53 +00:00
|
|
|
|
|
|
|
## Twilio Attributes
|
2022-07-08 12:50:07 +00:00
|
|
|
json.messaging_service_sid resource.channel.try(:messaging_service_sid)
|
2021-09-14 17:14:53 +00:00
|
|
|
json.phone_number resource.channel.try(:phone_number)
|
2021-09-16 11:21:06 +00:00
|
|
|
json.medium resource.channel.try(:medium) if resource.twilio?
|
2021-09-14 17:14:53 +00:00
|
|
|
|
2022-01-26 23:59:48 +00:00
|
|
|
if resource.email?
|
|
|
|
## Email Channel Attributes
|
|
|
|
json.forward_to_email resource.channel.try(:forward_to_email)
|
|
|
|
json.email resource.channel.try(:email)
|
2021-09-14 17:14:53 +00:00
|
|
|
|
2022-01-26 23:59:48 +00:00
|
|
|
## IMAP
|
2022-04-11 14:07:20 +00:00
|
|
|
json.imap_login resource.channel.try(:imap_login)
|
2022-01-26 23:59:48 +00:00
|
|
|
json.imap_password resource.channel.try(:imap_password)
|
|
|
|
json.imap_address resource.channel.try(:imap_address)
|
|
|
|
json.imap_port resource.channel.try(:imap_port)
|
|
|
|
json.imap_enabled resource.channel.try(:imap_enabled)
|
|
|
|
json.imap_enable_ssl resource.channel.try(:imap_enable_ssl)
|
2021-11-19 06:22:27 +00:00
|
|
|
|
2022-01-26 23:59:48 +00:00
|
|
|
## SMTP
|
2022-04-11 14:07:20 +00:00
|
|
|
json.smtp_login resource.channel.try(:smtp_login)
|
2022-01-26 23:59:48 +00:00
|
|
|
json.smtp_password resource.channel.try(:smtp_password)
|
|
|
|
json.smtp_address resource.channel.try(:smtp_address)
|
|
|
|
json.smtp_port resource.channel.try(:smtp_port)
|
|
|
|
json.smtp_enabled resource.channel.try(:smtp_enabled)
|
|
|
|
json.smtp_domain resource.channel.try(:smtp_domain)
|
2022-02-08 11:26:13 +00:00
|
|
|
json.smtp_enable_ssl_tls resource.channel.try(:smtp_enable_ssl_tls)
|
|
|
|
json.smtp_enable_starttls_auto resource.channel.try(:smtp_enable_starttls_auto)
|
|
|
|
json.smtp_openssl_verify_mode resource.channel.try(:smtp_openssl_verify_mode)
|
2022-04-11 10:13:05 +00:00
|
|
|
json.smtp_authentication resource.channel.try(:smtp_authentication)
|
2022-01-26 23:59:48 +00:00
|
|
|
end
|
2021-11-19 06:22:27 +00:00
|
|
|
|
2021-09-14 17:14:53 +00:00
|
|
|
## API Channel Attributes
|
2022-01-26 23:59:48 +00:00
|
|
|
if resource.api?
|
2022-07-06 19:47:39 +00:00
|
|
|
json.hmac_token resource.channel.try(:hmac_token)
|
2022-01-26 23:59:48 +00:00
|
|
|
json.webhook_url resource.channel.try(:webhook_url)
|
|
|
|
json.inbox_identifier resource.channel.try(:identifier)
|
2022-06-10 13:10:29 +00:00
|
|
|
json.additional_attributes resource.channel.try(:additional_attributes)
|
2022-01-26 23:59:48 +00:00
|
|
|
end
|
2022-06-07 12:03:33 +00:00
|
|
|
|
|
|
|
### WhatsApp Channel
|
2022-06-29 06:22:55 +00:00
|
|
|
if resource.whatsapp?
|
2022-07-06 19:45:03 +00:00
|
|
|
json.provider resource.channel.try(:provider)
|
2022-06-29 06:22:55 +00:00
|
|
|
json.message_templates resource.channel.try(:message_templates)
|
2022-07-06 19:45:03 +00:00
|
|
|
json.provider_config resource.channel.try(:provider_config) if Current.account_user&.administrator?
|
2022-06-29 06:22:55 +00:00
|
|
|
end
|