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

abuse_report_mailer.rb « mailers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e032f568913f185047013e9e24ed2b46a837ed89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

class AbuseReportMailer < BaseMailer
  def notify(abuse_report_id)
    return unless deliverable?

    @abuse_report = AbuseReport.find(abuse_report_id)

    mail(
      to:       Gitlab::CurrentSettings.admin_notification_email,
      subject:  "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse"
    )
  end

  private

  def deliverable?
    Gitlab::CurrentSettings.admin_notification_email.present?
  end
end