2018-08-15 17:45:57 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-01-27 16:08:47 -05:00
|
|
|
class AbuseReportMailer < ApplicationMailer
|
2019-02-20 10:18:15 -05:00
|
|
|
layout 'empty_mailer'
|
|
|
|
|
|
|
|
helper EmailsHelper
|
|
|
|
|
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(
|
2022-08-01 11:11:13 -04:00
|
|
|
to: Gitlab::CurrentSettings.abuse_notification_email,
|
|
|
|
subject: "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse"
|
2015-10-18 05:58:45 -04:00
|
|
|
)
|
2015-10-08 11:13:28 -04:00
|
|
|
end
|
2016-01-04 18:56:48 -05:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def deliverable?
|
2020-09-25 20:09:35 -04:00
|
|
|
Gitlab::CurrentSettings.abuse_notification_email.present?
|
2016-01-04 18:56:48 -05:00
|
|
|
end
|
2015-10-08 11:13:28 -04:00
|
|
|
end
|