From 958bd8c70c4dd426e008b83ce22bac04efde6daf Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sat, 2 Sep 2017 14:06:23 -0400 Subject: [PATCH] improve email styling for release --- .../daily_summary.html.erb | 55 +++++++++++++++---- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/app/views/map_activity_mailer/daily_summary.html.erb b/app/views/map_activity_mailer/daily_summary.html.erb index bd9f79da..8c3a2ef1 100644 --- a/app/views/map_activity_mailer/daily_summary.html.erb +++ b/app/views/map_activity_mailer/daily_summary.html.erb @@ -1,19 +1,42 @@ <% button_style = "background-color:#4fc059;border-radius:2px;color:white;display:inline-block;font-family:Roboto,Arial,Helvetica,sans-serif;font-size:12px;font-weight:bold;min-height:29px;line-height:29px;min-width:54px;outline:0px;padding:0 8px;text-align:center;text-decoration:none" %> +

Hey <%= @user.name %>, there was activity by others in the last 24 hours on map <%= link_to @map.name, map_url(@map) %>

-

# of messages: <%= @summary_data[:stats][:messages_sent] || 0 %>

-

# of topics added: <%= @summary_data[:stats][:topics_added] || 0 %>

-

# of topics moved: <%= @summary_data[:stats][:topics_moved] || 0%>

-

# of topics removed: <%= @summary_data[:stats][:topics_removed] || 0 %>

-

# of synapses added: <%= @summary_data[:stats][:synapses_added] || 0 %>

-

# of synapses removed: <%= @summary_data[:stats][:synapses_removed] || 0 %>

+
+ <% if @summary_data[:stats][:messages_sent] > 0 %> +

<%= pluralize(@summary_data[:stats][:messages_sent], 'message') %>

+ <% end %> + <% if @summary_data[:stats][:topics_added] > 0 %> +

<%= pluralize(@summary_data[:stats][:topics_added], 'topic') %> added

+ <% end %> + <% if @summary_data[:stats][:synapses_added] > 0 %> +

<%= pluralize(@summary_data[:stats][:synapses_added], 'synapse') %> added

+ <% end %> + <% if @summary_data[:stats][:topics_moved] > 0 %> +

<%= pluralize(@summary_data[:stats][:topics_moved], 'topic') %> moved

+ <% end %> + <% if @summary_data[:stats][:topics_removed] > 0 %> +

<%= pluralize(@summary_data[:stats][:topics_removed], 'topic') %> removed

+ <% end %> + <% if @summary_data[:stats][:synapses_removed] > 0 %> +

<%= pluralize(@summary_data[:stats][:synapses_removed], 'synapse') %> removed

+ <% end %> +

<% if @summary_data[:topics_added] %> -

Topics Added

+

Topics Added