Files
nairobi/app/views/mailer/proposal_notification_digest.html.erb
taitus 73f710e737 Unify format and indentation for sanitize, i18n and links on emails
In the mail section we have very different indentations and formatting in
 texts with sanitize, links and texts with interpolations. In my opinion it
helps a lot to have clearer indentations in these cases.

This may not be the best way to indent them, but at least I think it is
clearer than it was and at least relatively unified.
2022-06-02 17:56:18 +02:00

77 lines
2.9 KiB
Plaintext

<td style="<%= css_for_mailer_content %>">
<h1 style="<%= css_for_mailer_heading %>">
<%= t("mailers.proposal_notification_digest.title",
org_name: Setting["org_name"]) %>
</h1>
<p style="<%= css_for_mailer_text %>">
<%= t("mailers.proposal_notification_digest.info",
org_name: Setting["org_name"]) %>
</p>
<% @notifications.each do |notification| %>
<table style="width: 100%; border-top: 1px solid #DEE0E3; padding-top: 12px;">
<tbody>
<tr>
<td style="padding-bottom: 20px; padding-left: 10px;">
<h2 style="<%= css_for_mailer_subheading %>">
<%= link_to notification.notifiable.title, proposal_url(notification.notifiable.proposal, anchor: "tab-notifications"), style: css_for_mailer_link %>
</h2>
<p style="<%= css_for_mailer_text %>">
<%= notification.notifiable.proposal.title %>&nbsp;&bull;&nbsp;
<%= notification.notifiable.proposal.created_at.to_date %>&nbsp;&bull;&nbsp;
<%= notification.notifiable.proposal.author.name %>
</p>
<p style="<%= css_for_mailer_text %>">
<%= notification.notifiable.body %>
</p>
<table style="width: 100%;">
<tbody>
<tr>
<td style="padding-bottom: 12px;">
<%= link_to proposal_url(notification.notifiable.proposal, anchor: "social-share"), style: css_for_mailer_button do %>
<%= t("mailers.proposal_notification_digest.share") %>
<% end %>
<%= link_to proposal_url(notification.notifiable.proposal, anchor: "comments"), style: css_for_mailer_button do %>
<%= t("mailers.proposal_notification_digest.comment") %>
<% end %>
</td>
</tr>
<tr>
<td>
<p style="<%= css_for_mailer_text %>">
<%= sanitize(
link_to(
t("mailers.proposal_notification_digest.unfollow"),
proposal_url(notification.notifiable.proposal),
style: css_for_mailer_link
),
attributes: %w[href style]
) %>
</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<% end %>
<p style="<%= css_for_mailer_text %>">
<%= sanitize(
t("mailers.proposal_notification_digest.unsubscribe_text",
notifications: link_to(
t("mailers.config.notifications_link"),
edit_subscriptions_url(token: @token),
style: css_for_mailer_link)
),
attributes: %w[href style]
) %>
</p>
</td>