Class: IssueEmailParticipants::CreateService
- Inherits:
-
BaseService
- Object
- BaseContainerService
- BaseProjectService
- BaseService
- IssueEmailParticipants::CreateService
- Includes:
- Gitlab::Utils::StrongMemoize
- Defined in:
- app/services/issue_email_participants/create_service.rb
Constant Summary collapse
- MAX_NUMBER_OF_RECORDS =
10
Constants inherited from BaseService
BaseService::MAX_NUMBER_OF_EMAILS
Instance Attribute Summary
Attributes inherited from BaseService
Attributes inherited from BaseProjectService
Attributes inherited from BaseContainerService
#container, #current_user, #group, #params, #project
Instance Method Summary collapse
Methods inherited from BaseService
Methods inherited from BaseProjectService
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
Constructor Details
This class inherits a constructor from IssueEmailParticipants::BaseService
Instance Method Details
#execute ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/services/issue_email_participants/create_service.rb', line 9 def execute return error_feature_flag unless Feature.enabled?(:issue_email_participants, target.project) return error_underprivileged unless user_privileged? return error_no_participants_added unless emails.present? added_emails = add_participants(deduplicate_and_limit_emails) if added_emails.any? = add_system_note(added_emails) ServiceResponse.success(message: .upcase_first << ".") else error_no_participants_added end end |