abuse_report_mailer.rb 532 Bytes
Newer Older
gfyoung's avatar
gfyoung committed
1
2
# frozen_string_literal: true

3
class AbuseReportMailer < ApplicationMailer
4
5
6
7
  layout 'empty_mailer'

  helper EmailsHelper

8
  def notify(abuse_report_id)
9
10
    return unless deliverable?

11
    @abuse_report = AbuseReport.find(abuse_report_id)
12

13
    mail(
14
      to:       Gitlab::CurrentSettings.admin_notification_email,
15
16
      subject:  "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse"
    )
17
  end
18
19
20
21

  private

  def deliverable?
22
    Gitlab::CurrentSettings.admin_notification_email.present?
23
  end
24
end