Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/remote_mirrors.rb12
-rw-r--r--app/mailers/notify.rb1
-rw-r--r--app/mailers/previews/notify_preview.rb8
3 files changed, 21 insertions, 0 deletions
diff --git a/app/mailers/emails/remote_mirrors.rb b/app/mailers/emails/remote_mirrors.rb
new file mode 100644
index 00000000000..2018eb7260b
--- /dev/null
+++ b/app/mailers/emails/remote_mirrors.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+module Emails
+ module RemoteMirrors
+ def remote_mirror_update_failed_email(remote_mirror_id, recipient_id)
+ @remote_mirror = RemoteMirrorFinder.new(id: remote_mirror_id).execute
+ @project = @remote_mirror.project
+
+ mail(to: recipient(recipient_id), subject: subject('Remote mirror update failed'))
+ end
+ end
+end
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index 88ad4c3e893..099ad779aa5 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -13,6 +13,7 @@ class Notify < BaseMailer
include Emails::Pipelines
include Emails::Members
include Emails::AutoDevops
+ include Emails::RemoteMirrors
helper MergeRequestsHelper
helper DiffHelper
diff --git a/app/mailers/previews/notify_preview.rb b/app/mailers/previews/notify_preview.rb
index e7e8d96eca4..2ac4610967d 100644
--- a/app/mailers/previews/notify_preview.rb
+++ b/app/mailers/previews/notify_preview.rb
@@ -145,6 +145,10 @@ class NotifyPreview < ActionMailer::Preview
Notify.autodevops_disabled_email(pipeline, user.email).message
end
+ def remote_mirror_update_failed_email
+ Notify.remote_mirror_update_failed_email(remote_mirror.id, user.id).message
+ end
+
private
def project
@@ -167,6 +171,10 @@ class NotifyPreview < ActionMailer::Preview
@pipeline = Ci::Pipeline.last
end
+ def remote_mirror
+ @remote_mirror ||= RemoteMirror.last
+ end
+
def user
@user ||= User.last
end