Also send event updates if physical address changed

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-06-04 15:41:58 +02:00
parent 03b1f84fba
commit 9e3107e3aa
22 changed files with 466 additions and 127 deletions

View File

@@ -17,7 +17,7 @@ defmodule Mobilizon.Web.Email.Event do
alias Mobilizon.Web.{Email, Gettext}
@important_changes [:title, :begins_on, :ends_on, :status]
@important_changes [:title, :begins_on, :ends_on, :status, :physical_address]
@spec event_updated(User.t(), Actor.t(), Event.t(), Event.t(), MapSet.t(), String.t()) ::
Bamboo.Email.t()

View File

@@ -86,6 +86,24 @@
</td>
</tr>
<% end %>
<%= if MapSet.member?(@changes, :physical_address) do %>
<tr>
<td bgcolor="#ffffff" align="left">
<%= gettext "Event address" %>
</td>
<%= unless is_nil(@event.physical_address) do %>
<td bgcolor="#ffffff" align="left">
<p>
<%= Mobilizon.Addresses.Address.representation(@event.physical_address) %>
</p>
</td>
<% else %>
<td bgcolor="#ffffff" align="left">
<%= gettext "Physical address was removed" %>
</td>
<% end %>
</tr>
<% end %>
</table>
</td>
</tr>