2018-08-15 17:45:57 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-10-08 11:13:28 -04:00
|
|
|
class AbuseReportMailer < BaseMailer
|
2015-10-18 05:58:45 -04:00
|
|
|
def notify(abuse_report_id)
|
2016-01-04 18:56:48 -05:00
|
|
|
return unless deliverable?
|
|
|
|
|
2015-10-18 05:58:45 -04:00
|
|
|
@abuse_report = AbuseReport.find(abuse_report_id)
|
2015-10-08 11:13:28 -04:00
|
|
|
|
2015-10-18 05:58:45 -04:00
|
|
|
mail(
|
2018-02-02 13:39:55 -05:00
|
|
|
to: Gitlab::CurrentSettings.admin_notification_email,
|
2015-10-18 05:58:45 -04:00
|
|
|
subject: "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse"
|
|
|
|
)
|
2015-10-08 11:13:28 -04:00
|
|
|
end
|
2016-01-04 18:56:48 -05:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def deliverable?
|
2018-02-02 13:39:55 -05:00
|
|
|
Gitlab::CurrentSettings.admin_notification_email.present?
|
2016-01-04 18:56:48 -05:00
|
|
|
end
|
2015-10-08 11:13:28 -04:00
|
|
|
end
|