diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-22 15:09:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-22 15:09:39 +0300 |
commit | 26879909dd0571b392f105373a700a314201cd53 (patch) | |
tree | 800cb6476926e919ce7cabdcadd58a1cdb3178e1 /app/mailers | |
parent | 1086ac5177a6762ac14bccc6ce5584781bd44d1c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/emails/projects.rb | 10 |
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 |