Update "reply" notification email to add unsubscribe link
We modified the link that previously redirected us to the "My content" page to redirect us to the new page for managing subscriptions. We also adapted the existing generic text by adding a description of the related notification.
This commit is contained in:
@@ -20,6 +20,7 @@ class Mailer < ApplicationMailer
|
|||||||
def reply(reply)
|
def reply(reply)
|
||||||
@email = ReplyEmail.new(reply)
|
@email = ReplyEmail.new(reply)
|
||||||
@email_to = @email.to
|
@email_to = @email.to
|
||||||
|
manage_subscriptions_token(@email.recipient)
|
||||||
|
|
||||||
with_user(@email.recipient) do
|
with_user(@email.recipient) do
|
||||||
mail(to: @email_to, subject: @email.subject) if @email.can_be_sent?
|
mail(to: @email_to, subject: @email.subject) if @email.can_be_sent?
|
||||||
|
|||||||
@@ -18,6 +18,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 12px;font-weight: normal;line-height: 20px;">
|
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 12px;font-weight: normal;line-height: 20px;">
|
||||||
<%= t("mailers.config.manage_email_subscriptions") %> <%= link_to t("account.show.title"), account_url, style: "color: #2895F1; text-decoration:none;" %>
|
<%= sanitize(t("mailers.config.unsubscribe_text",
|
||||||
|
notifications: link_to(
|
||||||
|
t("mailers.config.notifications_link"),
|
||||||
|
edit_subscriptions_url(token: @token),
|
||||||
|
style: "color: #2895F1; text-decoration: none;"
|
||||||
|
),
|
||||||
|
notification: User.human_attribute_name(:email_on_comment_reply)
|
||||||
|
)) %>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -176,6 +176,9 @@ describe "System Emails" do
|
|||||||
expect(page).to have_content reply.body
|
expect(page).to have_content reply.body
|
||||||
|
|
||||||
expect(page).to have_link "Let's do...", href: comment_url(reply, host: app_host)
|
expect(page).to have_link "Let's do...", href: comment_url(reply, host: app_host)
|
||||||
|
expect(page).to have_link("Notifications",
|
||||||
|
href: edit_subscriptions_url(token: user.subscriptions_token,
|
||||||
|
host: app_host))
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "#direct_message_for_receiver" do
|
scenario "#direct_message_for_receiver" do
|
||||||
|
|||||||
@@ -198,8 +198,9 @@ describe "Emails" do
|
|||||||
expect(email).to deliver_to(user)
|
expect(email).to deliver_to(user)
|
||||||
expect(email).not_to have_body_text(debate_path(debate))
|
expect(email).not_to have_body_text(debate_path(debate))
|
||||||
expect(email).to have_body_text(comment_path(Comment.last))
|
expect(email).to have_body_text(comment_path(Comment.last))
|
||||||
expect(email).to have_body_text("To stop receiving these emails change your settings in")
|
expect(email).to have_body_text("To unsubscribe from these emails, visit")
|
||||||
expect(email).to have_body_text(account_path)
|
expect(email).to have_body_text(edit_subscriptions_path(token: user.subscriptions_token))
|
||||||
|
expect(email).to have_body_text('and uncheck "Notify me by email when someone replies to my comments"')
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Do not send email about own replies to own comments" do
|
scenario "Do not send email about own replies to own comments" do
|
||||||
@@ -469,8 +470,9 @@ describe "Emails" do
|
|||||||
expect(email).to deliver_to(user1)
|
expect(email).to deliver_to(user1)
|
||||||
expect(email).not_to have_body_text(poll_path(poll))
|
expect(email).not_to have_body_text(poll_path(poll))
|
||||||
expect(email).to have_body_text(comment_path(Comment.last))
|
expect(email).to have_body_text(comment_path(Comment.last))
|
||||||
expect(email).to have_body_text("To stop receiving these emails change your settings in")
|
expect(email).to have_body_text("To unsubscribe from these emails, visit")
|
||||||
expect(email).to have_body_text(account_path)
|
expect(email).to have_body_text(edit_subscriptions_path(token: user1.subscriptions_token))
|
||||||
|
expect(email).to have_body_text('and uncheck "Notify me by email when someone replies to my comments"')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user