scinote-web/app/views/users/mailer/notification.html.erb

28 lines
973 B
Text
Raw Normal View History

2016-10-05 16:52:27 +08:00
<p>Hello <%= @user.name %>!</p>
<p><%= I18n.t("notifications.email_title") %></p>
2016-10-05 16:52:27 +08:00
<p>Type: <%= I18n.t("notifications.types.#{@notification.type_of}") %></p>
<p>
2017-03-24 19:10:07 +08:00
<% if @notification.system_message? || @notification.deliver? %>
<% # We assume the system notification is clean %>
<%= @notification.title.html_safe %>
<% else %>
<%= sanitize_input(prepend_server_url_to_links(@notification.title)) %>
<% end %>
</p>
2016-10-05 16:52:27 +08:00
<p>
<% if @notification.system_message? %>
<% # We assume the system notification is clean %>
<%= @notification.message.html_safe %>
2017-03-24 19:10:07 +08:00
<% elsif @notification.deliver? %>
<% # work around the problem with inserting the link of zipExport %>
<% zip_id = /data-id='(\d*)'/.match(@notification.message)[1] %>
<%= @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>