2018-11-20 20:47:30 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
class RepositoryCheckMailer < BaseMailer
|
2018-12-05 23:21:45 +05:30
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2019-07-07 11:18:12 +05:30
|
|
|
layout 'empty_mailer'
|
|
|
|
|
|
|
|
helper EmailsHelper
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
def notify(failed_count)
|
2017-08-17 22:00:37 +05:30
|
|
|
@message =
|
|
|
|
if failed_count == 1
|
|
|
|
"One project failed its last repository check"
|
|
|
|
else
|
|
|
|
"#{failed_count} projects failed their last repository check"
|
|
|
|
end
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
mail(
|
|
|
|
to: User.admins.pluck(:email),
|
|
|
|
subject: "GitLab Admin | #{@message}"
|
|
|
|
)
|
|
|
|
end
|
2018-12-05 23:21:45 +05:30
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|