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

25 lines
537 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)
2022-10-11 01:57:18 +05:30
mail_with_locale(
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
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