2018-08-15 17:45:57 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-01-27 16:08:47 -05:00
|
|
|
class RepositoryCheckMailer < ApplicationMailer
|
2018-08-27 11:31:01 -04:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2019-02-20 10:18:15 -05:00
|
|
|
layout 'empty_mailer'
|
|
|
|
|
|
|
|
helper EmailsHelper
|
|
|
|
|
2016-04-04 11:23:43 -04:00
|
|
|
def notify(failed_count)
|
2017-02-22 10:10:32 -05: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 11:23:43 -04:00
|
|
|
|
|
|
|
mail(
|
2019-06-11 16:44:45 -04:00
|
|
|
to: User.admins.active.pluck(:email),
|
2016-04-18 04:58:40 -04:00
|
|
|
subject: "GitLab Admin | #{@message}"
|
2016-04-04 11:23:43 -04:00
|
|
|
)
|
|
|
|
end
|
2018-08-27 11:31:01 -04:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2016-04-04 11:23:43 -04:00
|
|
|
end
|