Update "comment" 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:
taitus
2020-12-29 12:26:55 +01:00
committed by Javi Martín
parent 2bfdc421ae
commit 0af765a3bd
7 changed files with 63 additions and 11 deletions

View File

@@ -9,6 +9,7 @@ class Mailer < ApplicationMailer
@comment = comment
@commentable = comment.commentable
@email_to = @commentable.author.email
manage_subscriptions_token(@commentable.author)
with_user(@commentable.author) do
subject = t("mailers.comment.subject", commentable: t("activerecord.models.#{@commentable.class.name.underscore}", count: 1).downcase)
@@ -150,4 +151,9 @@ class Mailer < ApplicationMailer
mail.perform_deliveries = false
end
end
def manage_subscriptions_token(user)
user.add_subscriptions_token
@token = user.subscriptions_token
end
end