UX: add email to '/email/unsubscribed' page

This commit is contained in:
Arpit Jalan 2017-06-10 09:43:41 +05:30
parent 2ffddfb32c
commit 6e37f09b19
3 changed files with 5 additions and 4 deletions

View File

@ -109,15 +109,16 @@ class EmailController < ApplicationController
redirect_to :back
else
if topic
redirect_to path("/email/unsubscribed?topic_id=#{topic.id}")
redirect_to path("/email/unsubscribed?topic_id=#{topic.id}&email=#{user.email}")
else
redirect_to path("/email/unsubscribed")
redirect_to path("/email/unsubscribed?email=#{user.email}")
end
end
end
def unsubscribed
@email = params[:email]
@topic = Topic.find_by(id: params[:topic_id].to_i) if params[:topic_id]
end

View File

@ -3,7 +3,7 @@
<h2><%=t "unsubscribed.title"%></h2>
<br>
<p>
<%=t("unsubscribed.description", url: path("/my/preferences")).html_safe %>
<%=t("unsubscribed.description", email: @email, url: path("/my/preferences")).html_safe %>
</p>
<% if @topic %>

View File

@ -723,7 +723,7 @@ en:
unsubscribed:
title: "Unsubscribed!"
description: "You have been unsubscribed. To change your email settings <a href='%{url}'>visit your user preferences</a>."
description: "<b>%{email}</b> has been unsubscribed. To change your email settings <a href='%{url}'>visit your user preferences</a>."
topic_description: "To re-subscribe to %{link}, use the notification control at the bottom or right of the topic."
unsubscribe: