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/services/notification_service.rb
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r--app/services/notification_service.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index 91e19d190bd..4c1db03fab8 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -66,6 +66,14 @@ class NotificationService
mailer.access_token_about_to_expire_email(user).deliver_later
end
+ # Notify a user when a previously unknown IP or device is used to
+ # sign in to their account
+ def unknown_sign_in(user, ip)
+ return unless user.can?(:receive_notifications)
+
+ mailer.unknown_sign_in_email(user, ip).deliver_later
+ end
+
# When create an issue we should send an email to:
#
# * issue assignee if their notification level is not Disabled
@@ -537,6 +545,18 @@ class NotificationService
end
end
+ def group_was_exported(group, current_user)
+ return true unless notifiable?(current_user, :mention, group: group)
+
+ mailer.group_was_exported_email(current_user, group).deliver_later
+ end
+
+ def group_was_not_exported(group, current_user, errors)
+ return true unless notifiable?(current_user, :mention, group: group)
+
+ mailer.group_was_not_exported_email(current_user, group, errors).deliver_later
+ end
+
protected
def new_resource_email(target, method)