summaryrefslogtreecommitdiff
path: root/app/mailers/emails/projects.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/mailers/emails/projects.rb')
-rw-r--r--app/mailers/emails/projects.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb
index fdf40a77ca4..17ef8b41e79 100644
--- a/app/mailers/emails/projects.rb
+++ b/app/mailers/emails/projects.rb
@@ -56,16 +56,14 @@ module Emails
subject: @message.subject)
end
- def prometheus_alert_fired_email(project_id, user_id, alert_payload)
+ def prometheus_alert_fired_email(project_id, user_id, alert_attributes)
@project = ::Project.find(project_id)
user = ::User.find(user_id)
- @alert = ::Gitlab::Alerting::Alert
- .new(project: @project, payload: alert_payload)
- .present
- return unless @alert.valid?
+ @alert = AlertManagement::Alert.new(alert_attributes.with_indifferent_access).present
+ return unless @alert.parsed_payload.has_required_attributes?
- subject_text = "Alert: #{@alert.full_title}"
+ subject_text = "Alert: #{@alert.email_title}"
mail(to: user.notification_email_for(@project.group), subject: subject(subject_text))
end
end