2018-11-20 20:47:30 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-10-24 18:46:33 +05:30
|
|
|
class AbuseReportMailer < BaseMailer
|
2019-07-07 11:18:12 +05:30
|
|
|
layout 'empty_mailer'
|
|
|
|
|
|
|
|
helper EmailsHelper
|
|
|
|
|
2015-10-24 18:46:33 +05:30
|
|
|
def notify(abuse_report_id)
|
2016-01-14 18:37:52 +05:30
|
|
|
return unless deliverable?
|
|
|
|
|
2015-10-24 18:46:33 +05:30
|
|
|
@abuse_report = AbuseReport.find(abuse_report_id)
|
|
|
|
|
|
|
|
mail(
|
2018-03-17 18:26:18 +05:30
|
|
|
to: Gitlab::CurrentSettings.admin_notification_email,
|
2015-10-24 18:46:33 +05:30
|
|
|
subject: "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse"
|
|
|
|
)
|
|
|
|
end
|
2016-01-14 18:37:52 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def deliverable?
|
2018-03-17 18:26:18 +05:30
|
|
|
Gitlab::CurrentSettings.admin_notification_email.present?
|
2016-01-14 18:37:52 +05:30
|
|
|
end
|
2015-10-24 18:46:33 +05:30
|
|
|
end
|