Chatwoot/app/mailers/administrator_notifications/channel_notifications_mailer.rb
2021-08-01 18:15:39 +05:30

23 lines
810 B
Ruby

class AdministratorNotifications::ChannelNotificationsMailer < ApplicationMailer
def slack_disconnect
return unless smtp_config_set_or_development?
subject = 'Your Slack integration has expired'
@action_url = "#{ENV['FRONTEND_URL']}/app/accounts/#{Current.account.id}/settings/integrations/slack"
send_mail_with_liquid(to: admin_emails, subject: subject) and return
end
def facebook_disconnect(inbox)
return unless smtp_config_set_or_development?
subject = 'Your Facebook page connection has expired'
@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
Current.account.administrators.pluck(:email)
end
end