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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 17:34:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 17:34:42 +0300
commit9f46488805e86b1bc341ea1620b866016c2ce5ed (patch)
treef9748c7e287041e37d6da49e0a29c9511dc34768 /app/mailers
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/groups.rb19
-rw-r--r--app/mailers/emails/notes.rb12
-rw-r--r--app/mailers/emails/profile.rb10
-rw-r--r--app/mailers/notify.rb1
-rw-r--r--app/mailers/previews/notify_preview.rb4
5 files changed, 46 insertions, 0 deletions
diff --git a/app/mailers/emails/groups.rb b/app/mailers/emails/groups.rb
new file mode 100644
index 00000000000..07812a01202
--- /dev/null
+++ b/app/mailers/emails/groups.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Emails
+ module Groups
+ def group_was_exported_email(current_user, group)
+ group_email(current_user, group, _('Group was exported'))
+ end
+
+ def group_was_not_exported_email(current_user, group, errors)
+ group_email(current_user, group, _('Group export error'), errors: errors)
+ end
+
+ def group_email(current_user, group, subj, errors: nil)
+ @group = group
+ @errors = errors
+ mail(to: current_user.notification_email_for(@group), subject: subject(subj))
+ end
+ end
+end
diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb
index 6dd4ccb510a..4b56ff60f09 100644
--- a/app/mailers/emails/notes.rb
+++ b/app/mailers/emails/notes.rb
@@ -40,6 +40,18 @@ module Emails
mail_answer_note_thread(@snippet, @note, note_thread_options(recipient_id, reason))
end
+ def note_design_email(recipient_id, note_id, reason = nil)
+ setup_note_mail(note_id, recipient_id)
+
+ design = @note.noteable
+ @target_url = ::Gitlab::Routing.url_helpers.designs_project_issue_url(
+ @note.resource_parent,
+ design.issue,
+ note_target_url_query_params.merge(vueroute: design.filename)
+ )
+ mail_answer_note_thread(design, @note, note_thread_options(recipient_id, reason))
+ end
+
private
def note_target_url_options
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb
index 441439444d5..4b19149a833 100644
--- a/app/mailers/emails/profile.rb
+++ b/app/mailers/emails/profile.rb
@@ -44,6 +44,16 @@ module Emails
mail(to: @user.notification_email, subject: subject(_("Your Personal Access Tokens will expire in %{days_to_expire} days or less") % { days_to_expire: @days_to_expire }))
end
end
+
+ def unknown_sign_in_email(user, ip)
+ @user = user
+ @ip = ip
+ @target_url = edit_profile_password_url
+
+ Gitlab::I18n.with_locale(@user.preferred_language) do
+ mail(to: @user.notification_email, subject: subject(_("Unknown sign-in from new location")))
+ end
+ end
end
end
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index 49eacc44519..d9483bab543 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -17,6 +17,7 @@ class Notify < ApplicationMailer
include Emails::AutoDevops
include Emails::RemoteMirrors
include Emails::Releases
+ include Emails::Groups
helper MilestonesHelper
helper MergeRequestsHelper
diff --git a/app/mailers/previews/notify_preview.rb b/app/mailers/previews/notify_preview.rb
index 38e1d9532a6..c931b5a848f 100644
--- a/app/mailers/previews/notify_preview.rb
+++ b/app/mailers/previews/notify_preview.rb
@@ -161,6 +161,10 @@ class NotifyPreview < ActionMailer::Preview
Notify.remote_mirror_update_failed_email(remote_mirror.id, user.id).message
end
+ def unknown_sign_in_email
+ Notify.unknown_sign_in_email(user, '127.0.0.1').message
+ end
+
private
def project