debian-mirror-gitlab/app/mailers/emails/admin_notification.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
652 B
Ruby
Raw Normal View History

2021-09-30 23:02:18 +05:30
# frozen_string_literal: true
module Emails
module AdminNotification
def send_admin_notification(user_id, subject, body)
user = User.find(user_id)
2021-11-11 11:23:49 +05:30
email = user.notification_email_or_default
2021-09-30 23:02:18 +05:30
@unsubscribe_url = unsubscribe_url(email: Base64.urlsafe_encode64(email))
@body = body
2022-10-11 01:57:18 +05:30
mail_with_locale to: email, subject: subject
2021-09-30 23:02:18 +05:30
end
def send_unsubscribed_notification(user_id)
user = User.find(user_id)
2021-11-11 11:23:49 +05:30
email = user.notification_email_or_default
2022-10-11 01:57:18 +05:30
mail_with_locale to: email, subject: "Unsubscribed from GitLab administrator notifications"
2021-09-30 23:02:18 +05:30
end
end
end
2022-08-27 11:52:29 +05:30
Emails::AdminNotification.prepend_mod