summaryrefslogtreecommitdiff
path: root/app/mailers/emails/admin_notification.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/mailers/emails/admin_notification.rb')
-rw-r--r--app/mailers/emails/admin_notification.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/mailers/emails/admin_notification.rb b/app/mailers/emails/admin_notification.rb
new file mode 100644
index 00000000000..f4540ef81a5
--- /dev/null
+++ b/app/mailers/emails/admin_notification.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Emails
+ module AdminNotification
+ def send_admin_notification(user_id, subject, body)
+ user = User.find(user_id)
+ email = user.notification_email
+ @unsubscribe_url = unsubscribe_url(email: Base64.urlsafe_encode64(email))
+ @body = body
+ mail to: email, subject: subject
+ end
+
+ def send_unsubscribed_notification(user_id)
+ user = User.find(user_id)
+ email = user.notification_email
+ mail to: email, subject: "Unsubscribed from GitLab administrator notifications"
+ end
+ end
+end