Class: ServiceDesk::CustomEmailVerifications::CreateService

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

Instance Attribute Summary collapse

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

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?

Constructor Details

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

Instance Attribute Details

#ramp_up_errorObject (readonly)

Returns the value of attribute ramp_up_error.



6
7
8
# File 'app/services/service_desk/custom_email_verifications/create_service.rb', line 6

def ramp_up_error
  @ramp_up_error
end

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/services/service_desk/custom_email_verifications/create_service.rb', line 8

def execute
  return error_feature_flag_disabled unless Feature.enabled?(:service_desk_custom_email, project)
  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
  send_verification_email_and_catch_delivery_errors

  if ramp_up_error
    handle_error_case
  else
    log_info
    ServiceResponse.success
  end
end