BigW Consortium Gitlab

abuse_report_mailer.rb 491 Bytes
Newer Older
1
class AbuseReportMailer < BaseMailer
2
  include Gitlab::CurrentSettings
3

4
  def notify(abuse_report_id)
5 6
    return unless deliverable?

7
    @abuse_report = AbuseReport.find(abuse_report_id)
8

9
    mail(
10
      to:       current_application_settings.admin_notification_email,
11 12
      subject:  "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse"
    )
13
  end
14 15 16 17 18 19

  private

  def deliverable?
    current_application_settings.admin_notification_email.present?
  end
20
end