Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-30 00:10:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-30 00:10:10 +0300
commite4df6a7c53ab6e9dd6d63516ca9e0ad143cfa17a (patch)
tree7a4b5a3a99f19f8610df164e9e5cdd4a461d1465 /app/mailers
parent13592f8455bfd17acd7cb10ccea015e3b63c155d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/projects.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb
index 2ae82b49609..06ba16f9724 100644
--- a/app/mailers/emails/projects.rb
+++ b/app/mailers/emails/projects.rb
@@ -60,9 +60,32 @@ module Emails
@project = project
@alert = alert.present
+ add_project_headers
+ add_alert_headers
+
subject_text = "Alert: #{@alert.email_title}"
mail(to: user.notification_email_for(@project.group), subject: subject(subject_text))
end
+
+ private
+
+ def add_alert_headers
+ return unless @alert
+
+ headers['X-GitLab-Alert-ID'] = @alert.id
+ headers['X-GitLab-Alert-IID'] = @alert.iid
+ headers['X-GitLab-NotificationReason'] = "alert_#{@alert.state}"
+
+ add_incident_headers
+ end
+
+ def add_incident_headers
+ incident = @alert.issue
+ return unless incident
+
+ headers['X-GitLab-Incident-ID'] = incident.id
+ headers['X-GitLab-Incident-IID'] = incident.iid
+ end
end
end