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

25 lines
532 B
Ruby
Raw Normal View History

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)
return unless deliverable?
2015-10-24 18:46:33 +05:30
@abuse_report = AbuseReport.find(abuse_report_id)
mail(
2021-01-03 14:25:43 +05:30
to: Gitlab::CurrentSettings.abuse_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?
2021-01-03 14:25:43 +05:30
Gitlab::CurrentSettings.abuse_notification_email.present?
end
2015-10-24 18:46:33 +05:30
end