Commit 4b71ae37 authored by Marin Jankovski's avatar Marin Jankovski

Send email notifying user he has been unsubscribed.

parent b9dc8e59
...@@ -10,7 +10,10 @@ class UnsubscribesController < ApplicationController ...@@ -10,7 +10,10 @@ class UnsubscribesController < ApplicationController
def create def create
@user = get_user @user = get_user
@user.admin_unsubscribe! if @user if @user
@user.admin_unsubscribe!
Notify.send_unsubscribed_notification(@user).deliver
end
redirect_to new_user_session_path, notice: 'You have been unsubscribed' redirect_to new_user_session_path, notice: 'You have been unsubscribed'
end end
......
...@@ -6,5 +6,10 @@ module Emails ...@@ -6,5 +6,10 @@ module Emails
@body = body @body = body
mail to: email, subject: subject mail to: email, subject: subject
end end
def send_unsubscribed_notification(user_id)
email = recipient(user_id)
mail to: email, subject: "Unsubscribed from GitLab administrator notifications"
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment