debian-mirror-gitlab/app/mailers/abuse_report_mailer.rb

25 lines
525 B
Ruby
Raw Normal View History

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)
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
private
def deliverable?
2018-03-17 18:26:18 +05:30
Gitlab::CurrentSettings.admin_notification_email.present?
end
2015-10-24 18:46:33 +05:30
end