diff options
Diffstat (limited to 'app/services/service_desk/custom_email_verifications')
3 files changed, 15 insertions, 5 deletions
diff --git a/app/services/service_desk/custom_email_verifications/base_service.rb b/app/services/service_desk/custom_email_verifications/base_service.rb index fe456e4d3f3..e92700022f1 100644 --- a/app/services/service_desk/custom_email_verifications/base_service.rb +++ b/app/services/service_desk/custom_email_verifications/base_service.rb @@ -3,6 +3,8 @@ module ServiceDesk module CustomEmailVerifications class BaseService < ::BaseProjectService + include ::ServiceDesk::CustomEmails::Logger + attr_reader :settings def initialize(project:, current_user: nil, params: {}) @@ -35,15 +37,21 @@ module ServiceDesk end def error_response(message) + log_warning(error_message: message) ServiceResponse.error(message: message) end def error_not_verified(error_identifier) + log_info(error_message: error_identifier.to_s) ServiceResponse.error( message: _('ServiceDesk|Custom email address could not be verified.'), reason: error_identifier.to_s ) end + + def log_category + 'custom_email_verification' + end end end end diff --git a/app/services/service_desk/custom_email_verifications/create_service.rb b/app/services/service_desk/custom_email_verifications/create_service.rb index db518bfdf24..9c5721446a1 100644 --- a/app/services/service_desk/custom_email_verifications/create_service.rb +++ b/app/services/service_desk/custom_email_verifications/create_service.rb @@ -17,6 +17,7 @@ module ServiceDesk if ramp_up_error handle_error_case else + log_info ServiceResponse.success end end @@ -63,11 +64,11 @@ module ServiceDesk end def error_settings_missing - error_response(_('ServiceDesk|Service Desk setting missing')) + error_response(s_('ServiceDesk|Service Desk setting missing')) end def error_user_not_authorized - error_response(_('ServiceDesk|User cannot manage project.')) + error_response(s_('ServiceDesk|User cannot manage project.')) end end end diff --git a/app/services/service_desk/custom_email_verifications/update_service.rb b/app/services/service_desk/custom_email_verifications/update_service.rb index 813624cde23..5ef36ce0576 100644 --- a/app/services/service_desk/custom_email_verifications/update_service.rb +++ b/app/services/service_desk/custom_email_verifications/update_service.rb @@ -24,6 +24,7 @@ module ServiceDesk else verification.mark_as_finished! + log_info ServiceResponse.success end end @@ -75,15 +76,15 @@ module ServiceDesk end def error_parameter_missing - error_response(_('ServiceDesk|Service Desk setting or verification object missing')) + error_response(s_('ServiceDesk|Service Desk setting or verification object missing')) end def error_already_finished - error_response(_('ServiceDesk|Custom email address has already been verified.')) + error_response(s_('ServiceDesk|Custom email address has already been verified.')) end def error_already_failed - error_response(_('ServiceDesk|Custom email address verification has already been processed and failed.')) + error_response(s_('ServiceDesk|Custom email address verification has already been processed and failed.')) end end end |