Add offer_unsupscription parameter to emails

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-10-18 11:08:17 +02:00
parent ea76805a90
commit f9ddeb80fb
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
3 changed files with 10 additions and 0 deletions

View File

@ -20,6 +20,7 @@ defmodule Mobilizon.Web.Email do
|> maybe_put_message_id()
|> assign(:jsonLDMetadata, nil)
|> assign(:instance_name, Config.instance_name())
|> assign(:offer_unsupscription, true)
|> put_html_layout({EmailView, "email.html"})
|> put_text_layout({EmailView, "email.text"})
end

View File

@ -34,6 +34,7 @@ defmodule Mobilizon.Web.Email.User do
|> assign(:locale, locale)
|> assign(:token, confirmation_token)
|> assign(:subject, subject)
|> assign(:offer_unsupscription, false)
|> render(:registration_confirmation)
end
@ -54,6 +55,7 @@ defmodule Mobilizon.Web.Email.User do
|> assign(:locale, locale)
|> assign(:token, reset_password_token)
|> assign(:subject, subject)
|> assign(:offer_unsupscription, false)
|> render(:password_reset)
end
@ -161,6 +163,7 @@ defmodule Mobilizon.Web.Email.User do
|> assign(:locale, user_locale)
|> assign(:subject, subject)
|> assign(:new_email, unconfirmed_email)
|> assign(:offer_unsupscription, false)
|> render(:email_changed_old)
end
@ -181,6 +184,7 @@ defmodule Mobilizon.Web.Email.User do
|> assign(:locale, user_locale)
|> assign(:subject, subject)
|> assign(:token, confirmation_token)
|> assign(:offer_unsupscription, false)
|> render(:email_changed_new)
end

View File

@ -145,6 +145,11 @@
<tr>
<td bgcolor="#ECEBF2" align="center" style="padding: 30px 30px 30px 30px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 400; line-height: 18px;" >
<p style="margin: 0;">
<%= if @offer_unsupscription do %>
<a href={"#{Mobilizon.Web.Endpoint.url()}/settings/notifications"}>
<%= gettext("Manage your notification settings") %>
</a>
<% end %>
<%= gettext("<b>%{instance}</b> is powered by Mobilizon.", instance: @instance_name) |> raw %><br />
<a href="https://joinmobilizon.org"><%= gettext "Learn more about Mobilizon here!" %></a>
</p>