summaryrefslogtreecommitdiff
path: root/app/mailers
diff options
context:
space:
mode:
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/repo_check_mailer.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/mailers/repo_check_mailer.rb b/app/mailers/repo_check_mailer.rb
new file mode 100644
index 00000000000..d98533f120d
--- /dev/null
+++ b/app/mailers/repo_check_mailer.rb
@@ -0,0 +1,16 @@
+class RepoCheckMailer < BaseMailer
+ include ActionView::Helpers::TextHelper
+
+ def notify(failed_count)
+ if failed_count == 1
+ @message = "One project failed its last repository check"
+ else
+ @message = "#{failed_count} projects failed their last repository check"
+ end
+
+ mail(
+ to: User.admins.pluck(:email),
+ subject: @message
+ )
+ end
+end