Improve sending pending participation notifications
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -92,7 +92,7 @@ defmodule Mobilizon.Web.Email.Notification do
|
||||
|
||||
@spec pending_participation_notification(User.t(), Event.t(), pos_integer()) :: Bamboo.Email.t()
|
||||
def pending_participation_notification(
|
||||
%User{locale: locale, email: email},
|
||||
%User{locale: locale, email: email, settings: %Setting{timezone: timezone}},
|
||||
%Event{} = event,
|
||||
total
|
||||
) do
|
||||
@@ -111,6 +111,7 @@ defmodule Mobilizon.Web.Email.Notification do
|
||||
|> assign(:locale, locale)
|
||||
|> assign(:event, event)
|
||||
|> assign(:total, total)
|
||||
|> assign(:timezone, timezone)
|
||||
|> assign(:subject, subject)
|
||||
|> render(:pending_participation_notification)
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<tbody style="vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
<!-- row for datetime -->
|
||||
<tr style="vertical-align: baseline; margin: 0; padding: 0; border: 0;" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0 12px 12px 0; border: 0;" valign="baseline" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0 12px 0 0; border: 0;" valign="baseline" align="left">
|
||||
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABgAAAAYADwa0LPAAAAf0lEQVRIx2NgGEDwH4opUsdEa1eiW+DNwMDwBM1F/wlgZHWPGRgYPPFZ+JgIAwnhR8gGMmIJT2oAuLl0jwOqAxZCXiQRYATx0A+iAYsDfABbUsYZZ0M/iIa+BeREMkmZkO5B9ARKk1tUMzBAinycwJOBsjrhEQMDgwetQ2WYAQCSDEUsvZlgYAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0xMC0xNFQxNDo1MTowNyswMDowMCvAzKIAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMTAtMTRUMTQ6NTE6MDcrMDA6MDBanXQeAAAAAElFTkSuQmCC" style="outline: none; text-decoration: none; width: 21px; max-width: 100%; clear: both; display: block; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
</td>
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0 0 12px; border: 0;" valign="top" align="left">
|
||||
@@ -29,7 +29,7 @@
|
||||
<%= if @event.physical_address do %>
|
||||
<!-- venue block -->
|
||||
<tr style="vertical-align: baseline; margin: 0; padding: 0; border: 0;" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0 12px 12px 0; border: 0;" valign="baseline" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0 12px 0 0; border: 0;" valign="baseline" align="left">
|
||||
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABgAAAAYADwa0LPAAABHklEQVRIx+XUsUoDQRQF0EMUtNPGYGsULMTeNuonqJ8SsNZ/kLSW/kEaLQykMvoJNoKdGkWCQrTYDS6b3c1O1i4XbjHz3rt35u2+YR5Qxznu8RGzj7M4VgnHGOAnhwMcVREfFYiPOZrFpD7l5Gm+YS1LaCHH4BSHqb1XXOIOW1hOxJYwxE3ZGzykTviCjUS8ERsmc/ohLXpPFV9k5LRNfvAJ1HIMvkrk1abUFKKX0aJGIr6Z0aJeltBijsEt9hLrVVGPr+L1CVYyakpjR/lfdMzdEAPoBoh3Q8XhIMBgfxYD6JQQ78wqTjSxnwXiQ2xXMYBWgUGrqjjRQGW16lr+WxaMOp4S4s9Y/y/xMZr4jtksWxRyxUfRk9HxN9FzgF/m1ZTuGrd6hAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0xMC0xNFQxNDo1Mjo0NyswMDowMES9eVsAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMTAtMTRUMTQ6NTI6NDcrMDA6MDA14MHnAAAAAElFTkSuQmCC" style="outline: none; text-decoration: none; width: 21px; max-width: 100%; clear: both; display: block; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
</td>
|
||||
<td class="m_8261046153705514309event__content_local" style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0; border: 0;" valign="top" align="left">
|
||||
@@ -42,7 +42,7 @@
|
||||
<% end %>
|
||||
<%= if @event.options.is_online do %>
|
||||
<tr style="vertical-align: baseline; margin: 0; padding: 0; border: 0;" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0 12px 12px 0; border: 0;" valign="baseline" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0 12px 0 0; border: 0;" valign="baseline" align="left">
|
||||
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABgAAAAYADwa0LPAAABWUlEQVRIx+WUP04CURDGf5pIQsROOAMHsNSgVmpp9AZ6AG1MiA1CsZ6DCxiwMx5BtKNQGs2uLf9aFov9DC8s++ftNiZOMpmdnW/mm8x78+A/SAVoAa/AVNoDmorlknNgDMwjdAyc5Snuq9ADUAM2pftARzE/C0nF6PwmBlcXZgSUbQhaRucABeAe8AAXcPQPoCvsnQ3Bm5Jq8h3C83cUO5DfsyGYKKkk31tB8K3YFosDD8l6BME8wQeYya7FYCIJBrI7su0VmPYSZoCFNNVRR36BYOYu4UN+FLZhQ2Be03oM7laYIbBtQwDB8vwuWpfgtpSkh0bnPnBqW9wkGRH9VAzzFC/KlgmW6IXg+k703TDGUrQtfgK8A7spsHvAh3JSyQbQN8bwBFwAVRaPXRW4BJ4NXF+5iXIdM/MkvUpD4OUgcJeLrdrkGdklVe4x8JWh+0/gKEdzf1R+ADQolKDXzQqjAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTEwLTE1VDEzOjA5OjAzKzAwOjAwbhSTzgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMC0xNVQxMzowOTowMyswMDowMB9JK3IAAAAASUVORK5CYII=" style="outline: none; text-decoration: none; width: 21px; max-width: 100%; clear: both; display: block; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
</td>
|
||||
<td class="m_8261046153705514309event__content_local" style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0; border: 0;" valign="top" align="left">
|
||||
@@ -55,52 +55,6 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<%= case @action do %>
|
||||
<% "participation" -> %>
|
||||
<div class="event__content_attend" style="vertical-align: middle; margin: 0; padding: 0; border: 0;">
|
||||
<table class="button btn-attend event__content_position" style="border-spacing: 0; border-collapse: collapse; vertical-align: baseline; text-align: left; width: auto; margin: 0; padding: 0; border: 0;">
|
||||
<tbody style="vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
<tr style="vertical-align: baseline; margin: 0; padding: 0; border: 0;" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0; border: 0;" valign="baseline" align="left">
|
||||
<table style="border-spacing: 0; border-collapse: collapse; vertical-align: baseline; text-align: left; margin: 0; padding: 0; border: 0;">
|
||||
<tbody style="vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
<tr style="vertical-align: baseline; margin: 0; padding: 0; border: 0;" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(255,255,255); font-family: Helvetica,Arial,sans-serif; font-weight: 500; line-height: 1.3; font-size: 16px; border-radius: 4px; margin: 0; padding: 0px; border: none;" valign="middle" bgcolor="FE3859" align="center">
|
||||
<a href={Routes.page_url(Mobilizon.Web.Endpoint, :event, @event.uuid)} style="color: rgb(255,255,255); font-family: Helvetica,Arial,sans-serif; font-weight: bold; text-align: left; line-height: 14px; text-decoration: none; vertical-align: baseline; font-size: 16px; display: inline-block; border-radius: 3px; white-space: nowrap; margin: 0; padding: 12px 32px; border: none;" target="_blank">
|
||||
<%= gettext("Manage your participation") %>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% "event" -> %>
|
||||
<div class="event__content_attend" style="vertical-align: middle; margin: 0; padding: 0; border: 0;">
|
||||
<table class="button btn-attend event__content_position" style="border-spacing: 0; border-collapse: collapse; vertical-align: baseline; text-align: left; width: auto; margin: 0; padding: 0; border: 0;">
|
||||
<tbody style="vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
<tr style="vertical-align: baseline; margin: 0; padding: 0; border: 0;" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0; border: 0;" valign="baseline" align="left">
|
||||
<table style="border-spacing: 0; border-collapse: collapse; vertical-align: baseline; text-align: left; margin: 0; padding: 0; border: 0;">
|
||||
<tbody style="vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
<tr style="vertical-align: baseline; margin: 0; padding: 0; border: 0;" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(255,255,255); font-family: Helvetica,Arial,sans-serif; font-weight: 500; line-height: 1.3; font-size: 16px; border-radius: 4px; margin: 0; padding: 0px; border: none;" valign="middle" bgcolor="FE3859" align="center">
|
||||
<a href={Routes.page_url(Mobilizon.Web.Endpoint, :event, @event.uuid)} style="color: rgb(255,255,255); font-family: Helvetica,Arial,sans-serif; font-weight: bold; text-align: left; line-height: 14px; text-decoration: none; vertical-align: baseline; font-size: 16px; display: inline-block; border-radius: 3px; white-space: nowrap; margin: 0; padding: 12px 32px; border: none;" target="_blank">
|
||||
<%= gettext("Participate") %>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
<%= gettext("Date:") %> <%= render("date/event_tz_date_range.text", event: @event, start_date: datetime_tz_convert(@event.begins_on, @event.options.timezone), end_date: datetime_tz_convert(@event.ends_on, @event.options.timezone), timezone: @timezone, locale: @locale) %>
|
||||
<%= gettext("Address:") %> <%= if @event.physical_address do %><%= render_address(@event.physical_address) %><% end %><%= if @event.options.is_online do %><%= gettext "Online event" %><% end %>
|
||||
|
||||
<%= case @action do %><% "participation" -> %><%= gettext("Manage your participation:") %> <%= Routes.page_url(Mobilizon.Web.Endpoint, :event, @event.uuid) %><% "event" -> %><%= gettext("Participate:") %> <%= Routes.page_url(Mobilizon.Web.Endpoint, :event, @event.uuid) %><% end %>
|
||||
@@ -5,7 +5,54 @@
|
||||
<% end %>
|
||||
<%= render("participation/card/_title.html", event: @event) %>
|
||||
<%= render("participation/card/_metadata.html", event: @event, timezone: @timezone, locale: @locale, action: @action) %>
|
||||
<%= if @event.description do %>
|
||||
<%= case @action do %>
|
||||
<% "participation" -> %>
|
||||
<div class="event__content_attend" style="vertical-align: middle; margin: 0; padding: 0; border: 0;">
|
||||
<table class="button btn-attend event__content_position" style="border-spacing: 0; border-collapse: collapse; vertical-align: baseline; text-align: left; width: auto; margin: 0; padding: 0; border: 0;">
|
||||
<tbody style="vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
<tr style="vertical-align: baseline; margin: 0; padding: 0; border: 0;" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0; border: 0;" valign="baseline" align="left">
|
||||
<table style="border-spacing: 0; border-collapse: collapse; vertical-align: baseline; text-align: left; margin: 0; padding: 0; border: 0;">
|
||||
<tbody style="vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
<tr style="vertical-align: baseline; margin: 0; padding: 0; border: 0;" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(255,255,255); font-family: Helvetica,Arial,sans-serif; font-weight: 500; line-height: 1.3; font-size: 16px; border-radius: 4px; margin: 0; padding: 0px; border: none;" valign="middle" bgcolor="FE3859" align="center">
|
||||
<a href={Routes.page_url(Mobilizon.Web.Endpoint, :event, @event.uuid)} style="color: rgb(255,255,255); font-family: Helvetica,Arial,sans-serif; font-weight: bold; text-align: left; line-height: 14px; text-decoration: none; vertical-align: baseline; font-size: 16px; display: inline-block; border-radius: 3px; white-space: nowrap; margin: 0; padding: 12px 32px; border: none;" target="_blank">
|
||||
<%= gettext("Manage your participation") %>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% "event" -> %>
|
||||
<div class="event__content_attend" style="vertical-align: middle; margin: 0; padding: 0; border: 0;">
|
||||
<table class="button btn-attend event__content_position" style="border-spacing: 0; border-collapse: collapse; vertical-align: baseline; text-align: left; width: auto; margin: 0; padding: 0; border: 0;">
|
||||
<tbody style="vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
<tr style="vertical-align: baseline; margin: 0; padding: 0; border: 0;" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(10,10,10); font-family: Helvetica,Arial,sans-serif; font-weight: normal; line-height: 1.3; font-size: 16px; margin: 0; padding: 0; border: 0;" valign="baseline" align="left">
|
||||
<table style="border-spacing: 0; border-collapse: collapse; vertical-align: baseline; text-align: left; margin: 0; padding: 0; border: 0;">
|
||||
<tbody style="vertical-align: baseline; margin: 0; padding: 0; border: 0;">
|
||||
<tr style="vertical-align: baseline; margin: 0; padding: 0; border: 0;" align="left">
|
||||
<td style="word-wrap: break-word; border-collapse: collapse; color: rgb(255,255,255); font-family: Helvetica,Arial,sans-serif; font-weight: 500; line-height: 1.3; font-size: 16px; border-radius: 4px; margin: 0; padding: 0px; border: none;" valign="middle" bgcolor="FE3859" align="center">
|
||||
<a href={Routes.page_url(Mobilizon.Web.Endpoint, :event, @event.uuid)} style="color: rgb(255,255,255); font-family: Helvetica,Arial,sans-serif; font-weight: bold; text-align: left; line-height: 14px; text-decoration: none; vertical-align: baseline; font-size: 16px; display: inline-block; border-radius: 3px; white-space: nowrap; margin: 0; padding: 12px 32px; border: none;" target="_blank">
|
||||
<%= gettext("Participate") %>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% nil -> %>
|
||||
<% end %>
|
||||
<%= if @event.description && @action != nil do %>
|
||||
<div class="event-working" style="vertical-align: baseline; margin: 0 0 0 10px; padding: 7.5px 0 15px; border: 0;">
|
||||
<p style="color: rgb(46,62,72); font-family: Helvetica,Arial,sans-serif; font-weight: 700; line-height: 1.5; font-size: 16px; vertical-align: baseline; margin: 0; padding: 0 0 7.5px; border: 0;" align="left">
|
||||
<%= gettext("Details") %>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
<%= render("participation/card/_metadata.text", event: @event, timezone: @timezone, locale: @locale, action: @action) %>
|
||||
|
||||
<%= case @action do %><% "participation" -> %><%= gettext("Manage your participation:") %> <%= Routes.page_url(Mobilizon.Web.Endpoint, :event, @event.uuid) %><% "event" -> %><%= gettext("Participate:") %> <%= Routes.page_url(Mobilizon.Web.Endpoint, :event, @event.uuid) %><% nil -> %><% end %>
|
||||
|
||||
<%= if @event.description do %><%= gettext("Details:") %>
|
||||
<%= process_description(@event.description) %>
|
||||
<%= if String.length(@event.description) > 200 do %><%= gettext("Read more : %{url}", url: Routes.page_url(Mobilizon.Web.Endpoint, :event, @event.uuid)) |> raw %><% end %><% end %>
|
||||
@@ -35,15 +35,20 @@
|
||||
<tr>
|
||||
<td bgcolor="#ffffff" align="left" style="padding: 20px 30px 0px 30px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;" >
|
||||
<p style="margin: 0;">
|
||||
<%= ngettext "You have one pending attendance request to process:", "You have %{number_participation_requests} attendance requests to process:", @total, number_participation_requests: @total %>
|
||||
<%= ngettext "You have one pending attendance request to process for the following event:", "You have %{number_participation_requests} attendance requests to process for the following event:", @total, number_participation_requests: @total %>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#ffffff" align="left" style="padding: 20px 30px 0px 30px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;" >
|
||||
<%= render("participation/event_card.html", event: @event, timezone: @timezone, locale: @locale, action: nil) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#ffffff" align="left" style="padding: 20px 30px 0px 30px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;" >
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td bgcolor="#ffffff" align="center" style="padding: 20px 30px 60px 30px;">
|
||||
<td bgcolor="#ffffff" align="center" style="padding: 20px 30px 30px 30px;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" style="border-radius: 3px;" bgcolor="#3C376E">
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<%= gettext "A request is pending!" %>
|
||||
==
|
||||
|
||||
<%= ngettext "You have one pending attendance request to process:", "You have %{number_participation_requests} attendance requests to process:", @total, number_participation_requests: @total %>
|
||||
<%= ngettext "You have one pending attendance request to process for the following event:", "You have %{number_participation_requests} attendance requests to process for the following event:", @total, number_participation_requests: @total %>
|
||||
|
||||
<%= render("participation/event_card.text", event: @event, timezone: @timezone, locale: @locale, action: nil) %>
|
||||
|
||||
<%= gettext "Manage pending requests" %> <%= Routes.page_url(Mobilizon.Web.Endpoint, :event, @event.uuid) <> "/participations" %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user