diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-23 21:10:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-23 21:10:41 +0300 |
commit | 6a6e9bec88480863cc3e8fb5edc50744e00da964 (patch) | |
tree | e663d6c9fe29259dd53f7bf10d4f5f796d467a2e /app/models/project.rb | |
parent | 9919ffe0c8760e1e19e068d67a5ae6ae8aa67c5d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 671b5cabc55..a57a3247c8a 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -2963,7 +2963,11 @@ class Project < ApplicationRecord alias_method :service_desk_enabled?, :service_desk_enabled def service_desk_address - service_desk_custom_address || service_desk_incoming_address + service_desk_custom_address || service_desk_system_address + end + + def service_desk_system_address + service_desk_alias_address || service_desk_incoming_address end def service_desk_incoming_address @@ -2975,7 +2979,7 @@ class Project < ApplicationRecord config.address&.gsub(wildcard, "#{full_path_slug}-#{default_service_desk_suffix}") end - def service_desk_custom_address + def service_desk_alias_address return unless Gitlab::Email::ServiceDeskEmail.enabled? key = service_desk_setting&.project_key || default_service_desk_suffix @@ -2983,6 +2987,13 @@ class Project < ApplicationRecord Gitlab::Email::ServiceDeskEmail.address_for_key("#{full_path_slug}-#{key}") end + def service_desk_custom_address + return unless Feature.enabled?(:service_desk_custom_email, self) + return unless service_desk_setting&.custom_email_enabled? + + service_desk_setting.custom_email + end + def default_service_desk_suffix "#{id}-issue-" end |