feat: IMAP Email Channel (#3298)

This change allows the user to configure both IMAP and SMTP for an email inbox. IMAP enables the user to see emails in Chatwoot. And user can use SMTP to reply to an email conversation.

Users can use the default settings to send and receive emails for email inboxes if both IMAP and SMTP are disabled.

Fixes #2520
This commit is contained in:
Aswin Dev P.S
2021-11-18 22:22:27 -08:00
committed by GitHub
parent 8384d0b38e
commit 24e6a92297
25 changed files with 1040 additions and 57 deletions

View File

@@ -45,6 +45,22 @@ json.medium resource.channel.try(:medium) if resource.twilio?
json.forward_to_email resource.channel.try(:forward_to_email)
json.email resource.channel.try(:email) if resource.email?
## 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?
## API Channel Attributes
json.webhook_url resource.channel.try(:webhook_url) if resource.api?
json.inbox_identifier resource.channel.try(:identifier) if resource.api?