diff options
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/abuse_report_mailer.rb | 4 | ||||
-rw-r--r-- | app/mailers/emails/members.rb | 9 | ||||
-rw-r--r-- | app/mailers/emails/merge_requests.rb | 11 | ||||
-rw-r--r-- | app/mailers/emails/projects.rb | 10 |
4 files changed, 26 insertions, 8 deletions
diff --git a/app/mailers/abuse_report_mailer.rb b/app/mailers/abuse_report_mailer.rb index 0f2f63b43f5..20aabb6fe58 100644 --- a/app/mailers/abuse_report_mailer.rb +++ b/app/mailers/abuse_report_mailer.rb @@ -11,7 +11,7 @@ class AbuseReportMailer < ApplicationMailer @abuse_report = AbuseReport.find(abuse_report_id) mail( - to: Gitlab::CurrentSettings.admin_notification_email, + to: Gitlab::CurrentSettings.abuse_notification_email, subject: "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse" ) end @@ -19,6 +19,6 @@ class AbuseReportMailer < ApplicationMailer private def deliverable? - Gitlab::CurrentSettings.admin_notification_email.present? + Gitlab::CurrentSettings.abuse_notification_email.present? end end diff --git a/app/mailers/emails/members.rb b/app/mailers/emails/members.rb index 3a13c5949bd..376b1a723c3 100644 --- a/app/mailers/emails/members.rb +++ b/app/mailers/emails/members.rb @@ -77,6 +77,15 @@ module Emails Gitlab::Tracking.event(Gitlab::Experimentation::EXPERIMENTS[:invite_email][:tracking_category], 'sent', property: 'control_group') end end + + if member.invite_to_unknown_user? && Gitlab::Experimentation.enabled?(:invitation_reminders) + Gitlab::Tracking.event( + Gitlab::Experimentation.experiment(:invitation_reminders).tracking_category, + 'sent', + property: Gitlab::Experimentation.enabled_for_attribute?(:invitation_reminders, member.invite_email) ? 'experimental_group' : 'control_group', + label: Digest::MD5.hexdigest(member.to_global_id.to_s) + ) + end end def member_invite_accepted_email(member_source_type, member_id) diff --git a/app/mailers/emails/merge_requests.rb b/app/mailers/emails/merge_requests.rb index c709c2950d6..2d1d271882d 100644 --- a/app/mailers/emails/merge_requests.rb +++ b/app/mailers/emails/merge_requests.rb @@ -34,6 +34,17 @@ module Emails end # rubocop: enable CodeReuse/ActiveRecord + # rubocop: disable CodeReuse/ActiveRecord + def changed_reviewer_of_merge_request_email(recipient_id, merge_request_id, previous_reviewer_ids, updated_by_user_id, reason = nil) + setup_merge_request_mail(merge_request_id, recipient_id) + + @previous_reviewers = [] + @previous_reviewers = User.where(id: previous_reviewer_ids) if previous_reviewer_ids.any? + + mail_answer_thread(@merge_request, merge_request_thread_options(updated_by_user_id, recipient_id, reason)) + end + # rubocop: enable CodeReuse/ActiveRecord + def relabeled_merge_request_email(recipient_id, merge_request_id, label_names, updated_by_user_id, reason = nil) setup_merge_request_mail(merge_request_id, recipient_id) 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 |