diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /lib/gitlab/email/handler/service_desk_handler.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'lib/gitlab/email/handler/service_desk_handler.rb')
-rw-r--r-- | lib/gitlab/email/handler/service_desk_handler.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/gitlab/email/handler/service_desk_handler.rb b/lib/gitlab/email/handler/service_desk_handler.rb index e3249b143c8..b507af3024e 100644 --- a/lib/gitlab/email/handler/service_desk_handler.rb +++ b/lib/gitlab/email/handler/service_desk_handler.rb @@ -74,7 +74,6 @@ module Gitlab attr_reader :project_id, :project_path, :service_desk_key def contains_custom_email_address_verification_subaddress? - return false unless Feature.enabled?(:service_desk_custom_email, project) return false unless to_address.present? # Verification email only has one recipient @@ -230,6 +229,9 @@ module Gitlab def add_email_participants return if reply_email? && !Feature.enabled?(:issue_email_participants, @issue.project) + # Migrate this to ::IssueEmailParticipants::CreateService once the + # feature flag issue_email_participants has been enabled globally + # or removed: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137147#note_1652104416 @issue.issue_email_participants.create(email: from_address) add_external_participants_from_cc @@ -239,11 +241,11 @@ module Gitlab return if project.service_desk_setting.nil? return unless project.service_desk_setting.add_external_participants_from_cc? - cc_addresses.each do |email| - next if service_desk_addresses.include?(email) - - @issue.issue_email_participants.create!(email: email) - end + ::IssueEmailParticipants::CreateService.new( + target: @issue, + current_user: Users::Internal.support_bot, + emails: cc_addresses.excluding(service_desk_addresses) + ).execute end def service_desk_addresses |