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
|
|
|
|
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
|
2021-09-14 17:14:53 +00:00
|
|
|
|
2021-12-15 18:54:50 +00:00
|
|
|
json.tweets_enabled resource.channel.try(:tweets_enabled) if resource.twitter?
|
|
|
|
|
2021-09-14 17:14:53 +00:00
|
|
|
## Channel specific settings
|
|
|
|
## TODO : Clean up and move the attributes into channel sub section
|
|
|
|
|
|
|
|
## 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)
|
|
|
|
end
|
2021-09-14 17:14:53 +00:00
|
|
|
|
|
|
|
## Facebook Attributes
|
|
|
|
json.page_id resource.channel.try(:page_id)
|
|
|
|
json.reauthorization_required resource.channel.try(:reauthorization_required?) if resource.facebook?
|
|
|
|
|
|
|
|
## Twilio Attributes
|
|
|
|
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
|
|
|
|
|
|
|
## Email Channel Attributes
|
|
|
|
json.forward_to_email resource.channel.try(:forward_to_email)
|
2021-09-09 18:30:52 +00:00
|
|
|
json.email resource.channel.try(:email) if resource.email?
|
2021-09-14 17:14:53 +00:00
|
|
|
|
2021-11-19 06:22:27 +00:00
|
|
|
## IMAP
|
|
|
|
json.imap_email resource.channel.try(:imap_email) if resource.email?
|
|
|
|
json.imap_password resource.channel.try(:imap_password) if resource.email?
|
|
|
|
json.imap_address resource.channel.try(:imap_address) if resource.email?
|
|
|
|
json.imap_port resource.channel.try(:imap_port) if resource.email?
|
|
|
|
json.imap_enabled resource.channel.try(:imap_enabled) if resource.email?
|
|
|
|
json.imap_enable_ssl resource.channel.try(:imap_enable_ssl) if resource.email?
|
|
|
|
|
|
|
|
## SMTP
|
|
|
|
json.smtp_email resource.channel.try(:smtp_email) if resource.email?
|
|
|
|
json.smtp_password resource.channel.try(:smtp_password) if resource.email?
|
|
|
|
json.smtp_address resource.channel.try(:smtp_address) if resource.email?
|
|
|
|
json.smtp_port resource.channel.try(:smtp_port) if resource.email?
|
|
|
|
json.smtp_enabled resource.channel.try(:smtp_enabled) if resource.email?
|
|
|
|
json.smtp_domain resource.channel.try(:smtp_domain) if resource.email?
|
|
|
|
|
2021-09-14 17:14:53 +00:00
|
|
|
## API Channel Attributes
|
2021-09-09 18:30:52 +00:00
|
|
|
json.webhook_url resource.channel.try(:webhook_url) if resource.api?
|
2021-08-27 14:26:45 +00:00
|
|
|
json.inbox_identifier resource.channel.try(:identifier) if resource.api?
|