chore: Disable fetching new emails after mailbox error (#4176)

- Disabled email fetch job if credentials for the channel isn't working
- notify customers when the email channel isn't working

fixes: https://github.com/chatwoot/chatwoot/issues/4174
This commit is contained in:
Sojan Jose
2022-03-22 12:14:17 +05:30
committed by GitHub
parent 715400f7ab
commit 467f3b9191
8 changed files with 48 additions and 8 deletions

View File

@@ -15,6 +15,14 @@ class AdministratorNotifications::ChannelNotificationsMailer < ApplicationMailer
send_mail_with_liquid(to: admin_emails, subject: subject) and return
end
def email_disconnect(inbox)
return unless smtp_config_set_or_development?
subject = 'Your email inbox has been disconnected. Please update the credentials for SMTP/IMAP'
@action_url = "#{ENV['FRONTEND_URL']}/app/accounts/#{Current.account.id}/settings/inboxes/#{inbox.id}"
send_mail_with_liquid(to: admin_emails, subject: subject) and return
end
private
def admin_emails