gitlab-org--gitlab-foss/app/mailers/abuse_report_mailer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
525 B
Ruby
Raw Normal View History

2018-08-15 17:45:57 -04:00
# frozen_string_literal: true
class AbuseReportMailer < ApplicationMailer
layout 'empty_mailer'
helper EmailsHelper
def notify(abuse_report_id)
return unless deliverable?
@abuse_report = AbuseReport.find(abuse_report_id)
mail(
to: Gitlab::CurrentSettings.abuse_notification_email,
subject: "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse"
)
end
private
def deliverable?
Gitlab::CurrentSettings.abuse_notification_email.present?
end
end