2018-08-15 21:45:57 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-04-06 11:47:05 +00:00
|
|
|
class RepositoryCheckMailer < BaseMailer
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2016-04-04 15:23:43 +00:00
|
|
|
def notify(failed_count)
|
2017-02-22 15:10:32 +00:00
|
|
|
@message =
|
|
|
|
if failed_count == 1
|
|
|
|
"One project failed its last repository check"
|
|
|
|
else
|
|
|
|
"#{failed_count} projects failed their last repository check"
|
|
|
|
end
|
2016-04-04 15:23:43 +00:00
|
|
|
|
|
|
|
mail(
|
|
|
|
to: User.admins.pluck(:email),
|
2016-04-18 08:58:40 +00:00
|
|
|
subject: "GitLab Admin | #{@message}"
|
2016-04-04 15:23:43 +00:00
|
|
|
)
|
|
|
|
end
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2016-04-04 15:23:43 +00:00
|
|
|
end
|