feat: add links to cancel anonymous participations in emails
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -26,6 +26,8 @@ defmodule Mobilizon.Web.PageController do
|
||||
defdelegate moderation_report(conn, params), to: PageController, as: :index
|
||||
@spec participation_email_confirmation(Plug.Conn.t(), any) :: Plug.Conn.t()
|
||||
defdelegate participation_email_confirmation(conn, params), to: PageController, as: :index
|
||||
@spec participation_email_cancellation(Plug.Conn.t(), any) :: Plug.Conn.t()
|
||||
defdelegate participation_email_cancellation(conn, params), to: PageController, as: :index
|
||||
@spec user_email_validation(Plug.Conn.t(), any) :: Plug.Conn.t()
|
||||
defdelegate user_email_validation(conn, params), to: PageController, as: :index
|
||||
@spec my_groups(Plug.Conn.t(), any) :: Plug.Conn.t()
|
||||
|
||||
@@ -99,6 +99,7 @@ defmodule Mobilizon.Web.Email.Participation do
|
||||
locale: locale,
|
||||
event: event,
|
||||
jsonLDMetadata: json_ld(participant),
|
||||
participant: participant,
|
||||
subject: subject
|
||||
})
|
||||
end
|
||||
@@ -123,6 +124,7 @@ defmodule Mobilizon.Web.Email.Participation do
|
||||
locale: locale,
|
||||
event: event,
|
||||
jsonLDMetadata: json_ld(participant),
|
||||
participant: participant,
|
||||
subject: subject
|
||||
})
|
||||
end
|
||||
|
||||
@@ -195,6 +195,12 @@ defmodule Mobilizon.Web.Router do
|
||||
|
||||
get("/participation/email/confirm/:token", PageController, :participation_email_confirmation)
|
||||
|
||||
get(
|
||||
"/participation/email/cancel/:uuid/:token",
|
||||
PageController,
|
||||
:participation_email_cancellation
|
||||
)
|
||||
|
||||
get("/validate/email/:token", PageController, :user_email_validation)
|
||||
|
||||
get("/groups/me", PageController, :my_groups)
|
||||
|
||||
@@ -87,14 +87,39 @@
|
||||
style="padding: 20px 30px 40px 30px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;"
|
||||
>
|
||||
<p style="margin: 0">
|
||||
<%= ngettext(
|
||||
"Would you wish to cancel your attendance, visit the event page through the link above and click the « Attending » button.",
|
||||
"Would you wish to cancel your attendance to one or several events, visit the event pages through the links above and click the « Attending » button.",
|
||||
1
|
||||
<%= gettext(
|
||||
"If you wish to cancel your participation, simply click on the link below."
|
||||
) %>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#ffffff" align="left">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td bgcolor="#ffffff" align="center" style="padding: 20px 30px 60px 30px;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" style="border-radius: 3px;">
|
||||
<a
|
||||
href={
|
||||
~p"/participation/email/cancel/#{@event.uuid}/#{@participant.metadata.cancellation_token}"
|
||||
|> url()
|
||||
|> URI.decode()
|
||||
}
|
||||
target="_blank"
|
||||
style="font-size: 20px; font-family: 'Roboto', Helvetica, Arial, sans-serif; color: #3C376E; text-decoration: none; padding: 15px 25px; border-radius: 2px; border: 1px solid #3C376E; display: inline-block;"
|
||||
>
|
||||
<%= gettext("Cancel my attendance") %>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
bgcolor="#ffffff"
|
||||
|
||||
@@ -88,19 +88,62 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
bgcolor="#ffffff"
|
||||
align="left"
|
||||
style="padding: 20px 30px 40px 30px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;"
|
||||
>
|
||||
<p style="margin: 0">
|
||||
<%= gettext(
|
||||
"Would you wish to update or cancel your attendance, simply access the event page through the link above and click on the Attending button."
|
||||
) %>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<%= if @participant.metadata.cancellation_token do %>
|
||||
<tr>
|
||||
<td
|
||||
bgcolor="#ffffff"
|
||||
align="left"
|
||||
style="padding: 20px 30px 40px 30px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;"
|
||||
>
|
||||
<p style="margin: 0">
|
||||
<%= gettext(
|
||||
"If you wish to cancel your participation, simply click on the link below."
|
||||
) %>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#ffffff" align="left">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td bgcolor="#ffffff" align="center" style="padding: 20px 30px 60px 30px;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" style="border-radius: 3px;">
|
||||
<a
|
||||
href={
|
||||
~p"/participation/email/cancel/#{@event.uuid}/#{@participant.metadata.cancellation_token}"
|
||||
|> url()
|
||||
|> URI.decode()
|
||||
}
|
||||
target="_blank"
|
||||
style="font-size: 20px; font-family: 'Roboto', Helvetica, Arial, sans-serif; color: #3C376E; text-decoration: none; padding: 15px 25px; border-radius: 2px; border: 1px solid #3C376E; display: inline-block;"
|
||||
>
|
||||
<%= gettext("Cancel my attendance") %>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td
|
||||
bgcolor="#ffffff"
|
||||
align="left"
|
||||
style="padding: 20px 30px 40px 30px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;"
|
||||
>
|
||||
<p style="margin: 0">
|
||||
<%= gettext(
|
||||
"Would you wish to update or cancel your attendance, simply access the event page through the link above and click on the Attending button."
|
||||
) %>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user