diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-01-05 14:11:15 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-01-05 14:11:15 +0000 |
commit | 9b1270280a65cc39c8dd908a12f8dbc7847ec971 (patch) | |
tree | 3a97e40a006d9ed0ff8951708f454ce9f0ea29fd /app/mailers | |
parent | 2479af4d5a67fb91ee05e691a27d0548ab4e80ea (diff) | |
parent | 46a220ae3c0e646aac63a3230399fcc8979df6ec (diff) | |
download | gitlab-ce-9b1270280a65cc39c8dd908a12f8dbc7847ec971.tar.gz |
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.rb | 10 |
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 |