scinote-web/app/views/users/mailer/notification.html.erb
Jure Grabnar 7877d559a3 Update email/notification, type: deliver
Closes [SCI-2643], [SCI-2644].
2018-09-23 18:45:13 +02:00

35 lines
1.2 KiB
Plaintext

<p>Hello <%= @user.name %>,</p>
<% unless @notification.deliver? %>
<p><%= I18n.t("notifications.email_title") %></p>
<p>Type: <%= I18n.t("notifications.types.#{@notification.type_of}") %></p>
<% end %>
<p>
<% if @notification.system_message? %>
<% # We assume the system notification is clean %>
<%= @notification.title.html_safe %>
<% elsif @notification.deliver? %>
<%= I18n.t("notifications.deliver.email_body").html_safe %>
<% else %>
<%= sanitize_input(prepend_server_url_to_links(@notification.title)) %>
<% end %>
</p>
<p>
<% if @notification.system_message? %>
<% # We assume the system notification is clean %>
<%= @notification.message.html_safe %>
<% elsif @notification.deliver? %>
<p>
<%= I18n.t("notifications.deliver.email_end_greeting").html_safe %>
</p>
<% # work around the problem with inserting the link of zipExport %>
<% zip_id = /data-id='(\d*)'/.match(@notification.message)[1] %>
<%= I18n.t("notifications.deliver.download_link") %>
<%= @notification.message.gsub(/href='.+'/, "href='#{zip_exports_download_url(zip_id)}'").html_safe %>
<% else %>
<%= sanitize_input(prepend_server_url_to_links(@notification.message)) %>
<% end %>
</p>