Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-05 17:11:15 +0300
committerDouwe Maan <douwe@gitlab.com>2016-01-05 17:11:15 +0300
commit9b1270280a65cc39c8dd908a12f8dbc7847ec971 (patch)
tree3a97e40a006d9ed0ff8951708f454ce9f0ea29fd /app/mailers
parent2479af4d5a67fb91ee05e691a27d0548ab4e80ea (diff)
parent46a220ae3c0e646aac63a3230399fcc8979df6ec (diff)
Merge branch 'rs-abuse-reports-refactor' into 'master'
Abuse Report refactors - Redirect back to user profile after report - "Tell, Don't Ask" for sending report notifications See merge request !2293
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/abuse_report_mailer.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/mailers/abuse_report_mailer.rb b/app/mailers/abuse_report_mailer.rb
index f0c41f69a5c..d0ce827a595 100644
--- a/app/mailers/abuse_report_mailer.rb
+++ b/app/mailers/abuse_report_mailer.rb
@@ -2,11 +2,19 @@ class AbuseReportMailer < BaseMailer
include Gitlab::CurrentSettings
def notify(abuse_report_id)
+ return unless deliverable?
+
@abuse_report = AbuseReport.find(abuse_report_id)
mail(
- to: current_application_settings.admin_notification_email,
+ to: current_application_settings.admin_notification_email,
subject: "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse"
)
end
+
+ private
+
+ def deliverable?
+ current_application_settings.admin_notification_email.present?
+ end
end