fix: Update email alerts for Slack integration (#7739)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Sojan Jose
2023-08-17 11:46:37 -07:00
committed by GitHub
parent ab039e14fd
commit 178bc80b25
8 changed files with 57 additions and 18 deletions

View File

@@ -80,10 +80,10 @@ class Integrations::Slack::SendOnSlackService < Base::SendOnChannelService
def send_message
post_message if message_content.present?
upload_file if message.attachments.any?
rescue Slack::Web::Api::Errors::AccountInactive => e
rescue Slack::Web::Api::Errors::AccountInactive, Slack::Web::Api::Errors::MissingScope => e
Rails.logger.error e
hook.authorization_error!
hook.disable if hook.enabled?
hook.prompt_reauthorization!
hook.disable
end
def post_message