diff options
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r-- | app/services/notification_service.rb | 20 |
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) |