2015-10-24 18:46:33 +05:30
|
|
|
class AbuseReportMailer < BaseMailer
|
|
|
|
include Gitlab::CurrentSettings
|
|
|
|
|
|
|
|
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(
|
2016-01-14 18:37:52 +05:30
|
|
|
to: current_application_settings.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?
|
|
|
|
current_application_settings.admin_notification_email.present?
|
|
|
|
end
|
2015-10-24 18:46:33 +05:30
|
|
|
end
|