2021-07-12 11:09:19 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Emails
|
|
|
|
module AdminNotification
|
|
|
|
def send_admin_notification(user_id, subject, body)
|
|
|
|
user = User.find(user_id)
|
2021-09-16 11:12:47 -04:00
|
|
|
email = user.notification_email_or_default
|
2021-07-12 11:09:19 -04:00
|
|
|
@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)
|
2021-09-16 11:12:47 -04:00
|
|
|
email = user.notification_email_or_default
|
2021-07-12 11:09:19 -04:00
|
|
|
mail to: email, subject: "Unsubscribed from GitLab administrator notifications"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2022-07-27 08:10:44 -04:00
|
|
|
|
|
|
|
Emails::AdminNotification.prepend_mod
|