Execute rake task every day to detect new actions available for not archived proposals. If there are new actions available for today, send email to proposal's author with information text, new actions available and link to proposal dashboard url.
75 lines
2.9 KiB
Plaintext
75 lines
2.9 KiB
Plaintext
<td style="padding-bottom: 20px;padding-left: 10px;font-size: 14px;font-weight: normal;
|
|
font-family:'Open Sans',arial,sans-serif;line-height: 24px; text-align: justify;">
|
|
|
|
<p><%= t("mailers.new_actions_notification_rake_published.hi", name: @proposal.author.name) %></p>
|
|
<p>
|
|
<%= t("mailers.new_actions_notification_rake_published.introduction",
|
|
published_at_day: @proposal.published_at.day,
|
|
published_at_month: @proposal.published_at.strftime("%B"),
|
|
title: @proposal.title) %>
|
|
</p>
|
|
<br>
|
|
<% first_resource = @new_actions.resources.first %>
|
|
<% if first_resource.present? %>
|
|
<p><%= t("mailers.new_actions_notification_rake_published.text_1", votes_count: @proposal.cached_votes_up) %></p>
|
|
<br>
|
|
<p><%= t("mailers.new_actions_notification_rake_published.text_2") %></p>
|
|
<br>
|
|
<p><%= t("mailers.new_actions_notification_rake_published.new_resource") %></p>
|
|
<ul>
|
|
<li><%= first_resource.title %></li>
|
|
</ul>
|
|
<br>
|
|
<% end %>
|
|
|
|
<% limit_to_archive_proposal = @proposal.created_at.to_date +
|
|
Setting["months_to_archive_proposals"].to_i.months %>
|
|
<p>
|
|
<%= t("mailers.new_actions_notification_rake_published.text_3",
|
|
days_count: (limit_to_archive_proposal - Date.today).to_i,
|
|
max_votes_count: Setting["votes_for_proposal_success"]) %>
|
|
</p>
|
|
|
|
<% first_proposed_action = @new_actions.proposed_actions.first %>
|
|
<% if first_proposed_action.present? %>
|
|
<p><%= t("mailers.new_actions_notification_rake_published.text_4") %></p>
|
|
<ul>
|
|
<li><%= first_proposed_action.title %></li>
|
|
<% if first_proposed_action.description.present? %>
|
|
<p><%= first_proposed_action.description.html_safe %></p>
|
|
<% end %>
|
|
</ul>
|
|
<br>
|
|
<% end %>
|
|
|
|
<% if @new_actions.proposed_actions.count > 1 %>
|
|
<% second_proposed_action = @new_actions.proposed_actions.second %>
|
|
<p><%= t("mailers.new_actions_notification_rake_published.text_5") %></p>
|
|
<ul>
|
|
<li><%= second_proposed_action.title %></li>
|
|
</ul>
|
|
<br>
|
|
<% end %>
|
|
|
|
<p><%= t("mailers.new_actions_notification_rake_published.footer_text") %></p>
|
|
|
|
<br>
|
|
<table style="width: 100%;">
|
|
<tbody>
|
|
<tr>
|
|
<td style="padding-bottom: 12px; padding-top: 24px; text-align: center;">
|
|
<%= link_to proposal_dashboard_url(@proposal),
|
|
style: "font-family: 'Open Sans',arial,sans-serif; background: #3700fd;
|
|
border-radius: 6px; color: #fff !important; font-weight: bold;
|
|
padding: 17px 20px; text-align: center; text-decoration: none;
|
|
font-size: 20px; min-width: 200px; display: inline-block;",
|
|
target: "_blank" do %>
|
|
<%= t("mailers.new_actions_notification_rake_published.dashboard_button") %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
</td>
|