feat: notify on slack disconnect (#1323)
This commit is contained in:
@@ -36,7 +36,7 @@ module Reauthorizable
|
||||
# could used to manually prompt reauthorization if auth scope changes
|
||||
def prompt_reauthorization!
|
||||
::Redis::Alfred.set(reauthorization_required_key, true)
|
||||
# TODO: send_reauthorize_prompt_email
|
||||
AdministratorNotifications::ChannelNotificationsMailer.slack_disconnect(account)&.deliver_later if (is_a? Integrations::Hook) && slack?
|
||||
end
|
||||
|
||||
# call this after you successfully Reauthorized the object in UI
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# reference_id :string
|
||||
#
|
||||
class Integrations::Hook < ApplicationRecord
|
||||
include Reauthorizable
|
||||
|
||||
validates :account_id, presence: true
|
||||
validates :app_id, presence: true
|
||||
|
||||
@@ -33,4 +35,8 @@ class Integrations::Hook < ApplicationRecord
|
||||
def slack?
|
||||
app_id == 'slack'
|
||||
end
|
||||
|
||||
def disable
|
||||
update(status: 'disabled')
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user