Class: ServiceDesk::CustomEmailVerifications::CreateService

Inherits:
BaseService show all
Defined in:
app/services/service_desk/custom_email_verifications/create_service.rb

Constant Summary collapse

SMTP_HOST_ERRORS =
[
  SocketError,
  OpenSSL::SSL::SSLError,
  Net::SMTPServerBusy,
  Net::SMTPSyntaxError,
  Net::SMTPFatalError,
  Net::SMTPUnsupportedCommand,
  Net::SMTPUnknownError
].freeze

Instance Attribute Summary

Attributes inherited from BaseService

#settings

Attributes inherited from BaseProjectService

#project

Attributes inherited from BaseContainerService

#container, #current_user, #group, #params, #project

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Methods inherited from BaseProjectService

#initialize

Methods inherited from BaseContainerService

#group_container?, #initialize, #namespace_container?, #project_container?, #project_group, #root_ancestor

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?, #can_all?, #can_any?

Constructor Details

This class inherits a constructor from ServiceDesk::CustomEmailVerifications::BaseService

Instance Method Details

#executeObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/services/service_desk/custom_email_verifications/create_service.rb', line 16

def execute
  return error_settings_missing unless settings.present?
  return error_user_not_authorized unless can?(current_user, :admin_project, project)

  update_settings
  notify_project_owners_and_user_about_verification_start
  ramp_up_error = send_verification_email_and_catch_delivery_errors

  if ramp_up_error
    handle_error_case(ramp_up_error)
  else
    log_info
    ServiceResponse.success
  end
end