2018-11-20 20:47:30 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
class AbuseReportMailer < ApplicationMailer
|
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(
|
2022-08-27 11:52:29 +05:30
|
|
|
to: Gitlab::CurrentSettings.abuse_notification_email,
|
|
|
|
subject: "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse"
|
2015-10-24 18:46:33 +05:30
|
|
|
)
|
|
|
|
end
|
2016-01-14 18:37:52 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def deliverable?
|
2021-01-03 14:25:43 +05:30
|
|
|
Gitlab::CurrentSettings.abuse_notification_email.present?
|
2016-01-14 18:37:52 +05:30
|
|
|
end
|
2015-10-24 18:46:33 +05:30
|
|
|
end
|