Class: EmailSettingsExceptionHandler::GmailProvider

Inherits:
GenericProvider show all
Defined in:
app/services/email_settings_exception_handler.rb

Instance Method Summary collapse

Methods inherited from GenericProvider

#initialize, #message

Constructor Details

This class inherits a constructor from EmailSettingsExceptionHandler::GenericProvider

Instance Method Details

#net_imap_no_response_errorObject



113
114
115
116
117
118
119
120
121
# File 'app/services/email_settings_exception_handler.rb', line 113

def net_imap_no_response_error
  # Gmail requires use of application-specific passwords when 2FA is enabled and return
  # a special error message calling this out.
  if @exception.message.match(/Application-specific password required/)
    I18n.t("email_settings.authentication_error_gmail_app_password")
  else
    super
  end
end

#net_smtp_authentication_errorObject



103
104
105
106
107
108
109
110
111
# File 'app/services/email_settings_exception_handler.rb', line 103

def net_smtp_authentication_error
  # Gmail requires use of application-specific passwords when 2FA is enabled and return
  # a special error message calling this out.
  if @exception.message.match(/Application-specific password required/)
    I18n.t("email_settings.authentication_error_gmail_app_password")
  else
    super
  end
end