Class: OauthCredentialMailer
- Inherits:
-
ApplicationMailer
- Object
- ActionMailer::Base
- ApplicationMailer
- OauthCredentialMailer
- Defined in:
- app/mailers/oauth_credential_mailer.rb
Overview
Alerts the responsible owner when an outbound OAuth credential's token can
no longer be refreshed automatically and needs a manual reconnect.
Instance Method Summary collapse
Methods inherited from ApplicationMailer
Instance Method Details
#refresh_failed(credential) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/mailers/oauth_credential_mailer.rb', line 9 def refresh_failed(credential) @provider = credential.provider.titleize @error = credential.&.dig('last_refresh_error') @failing_since = credential.&.dig('refresh_failing_since') @reconnect_url = credential.reconnect_url @user_facing = (credential.owner || credential.account)&.employee.present? mail( to: credential.alert_recipient_email, subject: "[Heatwave] #{@provider} integration needs reconnecting" ) end |