diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-12 18:09:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-12 18:09:19 +0300 |
commit | d9b3f39acad88d81eb7a75627c4325651fb7ff13 (patch) | |
tree | 9a10f44168d0d401c15b664c17e8a353674203b5 /app/mailers | |
parent | f81141c25d0dd79de8c07559bf268cb6e0d287d3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/emails/admin_notification.rb | 19 | ||||
-rw-r--r-- | app/mailers/notify.rb | 1 |
2 files changed, 20 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 diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index dd75ab4bf03..03b70fffde1 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -22,6 +22,7 @@ class Notify < ApplicationMailer include Emails::Reviews include Emails::ServiceDesk include Emails::InProductMarketing + include Emails::AdminNotification helper TimeboxesHelper helper MergeRequestsHelper |